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!
