plotting a function over time using a for loop
Ältere Kommentare anzeigen
I've been trying to set a matrix equal to the results of two functions over a range, but am not having any luck. Can someone proofread for me?
x1 = [1:0.01:3];
%set x to a variable from 1 to 3
b1=zeros(1,201);
y1=zeros(1,201);
for x2=1:201;
x3=x1(x2);
b1(x2)=sin(x3)+1;
y1(x2)=x3+exp(-x3/2);
end
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Loops and Conditional Statements finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
