plotting a function over time using a for loop
显示 更早的评论
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
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Loops and Conditional Statements 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
