plotting a function over time using a for loop
Afficher commentaires plus anciens
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
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Loops and Conditional Statements dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
