How can I add linspace in a For Loop

33 Ansichten (letzte 30 Tage)
Light
Light am 31 Mär. 2023
Kommentiert: Star Strider am 3 Apr. 2023

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 Kommentare
Dyuman Joshi
Dyuman Joshi am 31 Mär. 2023
Which x?
Show us what you have attempted.
Light
Light am 31 Mär. 2023
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.

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Star Strider
Star Strider am 31 Mär. 2023
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 Kommentare
Justin
Justin am 3 Apr. 2023
@Edson am doing something similiar and hopefully if you got through you can share what you ended up doing. Thanks in advance

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Graphics Performance finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by