How can I add linspace in a For Loop

조회 수: 33 (최근 30일)
Light
Light 2023년 3월 31일
댓글: Star Strider 2023년 4월 3일

Hello good day, I wish to have a 'for' or 'while' loop which keeps increasing the value of 'x' as the value of 'phi' keeps increasing from 0 - 77.3049 with 100 numbers. I attempted a few times but kept getting errors. Any idea how this can be implemented?

  댓글 수: 2
Dyuman Joshi
Dyuman Joshi 2023년 3월 31일
Which x?
Show us what you have attempted.
Light
Light 2023년 3월 31일
Sorry, X as the value which changes as the value of phi increases. I just cant figure out how to complete the for or while loop at the bottom.

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

채택된 답변

Star Strider
Star Strider 2023년 3월 31일
There is not enough information (such as a description of what you want to do).
However one possibility is something like this —
phi = linspace(0, 77.3049, 100);
for k = 1:numel(phi)
x(k) = some_calculation_using(phi(k));
end
.
  댓글 수: 42
Justin
Justin 2023년 4월 3일
@Edson am doing something similiar and hopefully if you got through you can share what you ended up doing. Thanks in advance

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

추가 답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by