How can I repeat this simulation 1000 times
    1 回表示 (過去 30 日間)
  
       古いコメントを表示
    
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 
0 件のコメント
採用された回答
  KALYAN ACHARJYA
      
      
 2019 年 2 月 4 日
        
      編集済み: KALYAN ACHARJYA
      
      
 2019 年 2 月 4 日
  
      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 件のコメント
その他の回答 (0 件)
参考
カテゴリ
				Help Center および File Exchange で Loops and Conditional Statements についてさらに検索
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!



