필터 지우기
필터 지우기

Saving Iterations in the loop

조회 수: 1 (최근 30일)
TTA
TTA 2016년 8월 24일
댓글: Andrei Bobrov 2016년 8월 24일
Somebody please help urgently. I want to save the values of iterations of Modata in the loop. The current code is not working.
Ro = 0.05:0.1:0.45;
ii = 20*pi/180:20*pi/180:90*pi/180;
BGammaMax = 0.5:0.1:3;
phi2 = 0:2*pi/60:2*pi;
L = []; for Ro_s = Ro for ii_s = ii for bg_s = BGammaMax for phi2_s = phi2; L2 =sqrt( Ro_s*ii_s)+(bg_s*phi2_s); L = [L;L2]; MoData = [Ro_s ii_s bg_s phi2_s L2] FN = (num2str(Ro_s), num2str(ii_s), num2str(bg_s), num2str(phi2), num2str(L)); dlmwrite('myFile.txt',FN,'delimiter',' '); end end end end
  댓글 수: 1
Andrei Bobrov
Andrei Bobrov 2016년 8월 24일
Please see repeat of this question.

댓글을 달려면 로그인하십시오.

답변 (1개)

Thorsten
Thorsten 2016년 8월 24일
편집: Thorsten 2016년 8월 24일
Just move the
L = [];
before the first loop:
L = [];
for Ro_s = Ro

카테고리

Help CenterFile Exchange에서 Network Connection and Exploration에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by