Effacer les filtres
Effacer les filtres

How can I repeat this simulation 1000 times

4 vues (au cours des 30 derniers jours)
Temi O
Temi O le 4 Fév 2019
Commenté : Temi O le 4 Fév 2019
U1= 13.5;
U2= 9;
dt= 0.01; %time step
MAXT= 0.5;%maximum time (s)
a= 1.2; % threshold
x1(1)=0.5*a;
x2(1)=0.5*a;
for i= 1:MAXT/dt;
x1(i+1) = x1(i) + dt*(U1-U2)+ sqrt(dt)*randn- sqrt(dt)*randn;
end

Réponse acceptée

KALYAN ACHARJYA
KALYAN ACHARJYA le 4 Fév 2019
Modifié(e) : KALYAN ACHARJYA le 4 Fév 2019
U1= 13.5;
U2= 9;
dt= 0.01; %time step
MAXT= 0.5;%maximum time (s)
a= 1.2; % threshold
x1(1)=0.5*a;
x2(1)=0.5*a;
inerations_nos=1;
while inerations_nos<1001
for i= 1:MAXT/dt;
x1(i+1) = x1(i) + dt*(U1-U2)+ sqrt(dt)*randn- sqrt(dt)*randn;
end
inerations_nos=inerations_nos+1;
end
or
for j=1:1000
%code
end
  8 commentaires
KALYAN ACHARJYA
KALYAN ACHARJYA le 4 Fév 2019
+1 @Luna Thumbs Up
Temi O
Temi O le 4 Fév 2019
Thank you very much. This has helped a lot!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Logical dans Help Center et File Exchange

Produits


Version

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by