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

2 次查看(过去 30 天)
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