필터 지우기
필터 지우기

How to convert this ...for loop to while loop ?

조회 수: 2 (최근 30일)
Hocine hoho
Hocine hoho 2021년 4월 10일
답변: David Fletcher 2021년 4월 10일
for i=1:5
for j=1:20
amp=i*1.2;
wt=j*0.05;
v(i,j)=amp*sin(wt);
end
end

채택된 답변

David Fletcher
David Fletcher 2021년 4월 10일
i=1;
while i<=5
j=1;
while j<=20
amp=i*1.2;
wt=j*0.05;
v(i,j)=amp*sin(wt);
j=j+1;
end
i=i+1;
end

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by