For Loop Help with Output

1 Ansicht (letzte 30 Tage)
Justin Manterrnacch
Justin Manterrnacch am 25 Jan. 2022
Beantwortet: David Hill am 25 Jan. 2022
Unsure how to make Y, over range x, output in matrix not a singular answer.
h=.1;
y=1;
for x=0:h:10
Y=y+h.*x;
end

Antworten (1)

David Hill
David Hill am 25 Jan. 2022
No for-loop needed.
h=.1;
y=1;
x=0:h:10;
Y=y+h*x;

Kategorien

Mehr zu Loops and Conditional Statements 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