Effacer les filtres
Effacer les filtres

Random number time series

5 vues (au cours des 30 derniers jours)
Bdayz
Bdayz le 13 Sep 2016
Commenté : Bdayz le 13 Sep 2016
Hi All,
I will like to generate Independent normally distributed data with linearly
increasing mean from say 2 to 4 and constant standard deviation, say 1.
Thank you.

Réponse acceptée

s.p4m
s.p4m le 13 Sep 2016
Modifié(e) : s.p4m le 13 Sep 2016
ln = 100; % length of timeseries
Ts = 1; % timestep
for k = 1:ln
tmp_mean = 2+2*(k-1)/(ln-1); % your linearly increasing mean
tmp_devi = 1; % your constant standard deviation
x(k,1) = random('norm',tmp_mean,tmp_devi,1,1);
end
timeseries = iddata(x,[],Ts);
  1 commentaire
Bdayz
Bdayz le 13 Sep 2016
Thanks very much. works perfectly

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Time Series dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by