plot what is calculated inside REPEATED for loop as one curve in one figure ?

조회 수: 1 (최근 30일)
omar th
omar th 2022년 8월 2일
댓글: Dyuman Joshi 2022년 8월 2일
can I plot x(i) outside the while and for loops ? which means I want to display one figure and one curve show me x value corresponding the number of for loop steps, for example for loop repeated itself 4 times, here I want to show me one curve of x corresponding 80 step
thanks in advance
while 1
for i=1:20 % Repeated itself 4 times which means there will be 80 value for "x"
x(i)=calculation
end
end
plot (xi)
  댓글 수: 1
Dyuman Joshi
Dyuman Joshi 2022년 8월 2일
If I am understanding correct
for j=1:4
for i=1:20
x(i,j)=calculation
end
end
You will get a 20x4 array and then you can plot the rows.

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Animation에 대해 자세히 알아보기

제품


릴리스

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by