Error plotting graph, with y behaving similar to step function
古いコメントを表示
Hi, i want to plot a graph where y=t^2 when t>0 and y=5 when t<0 giving that t=[-5:0.1:5]
t=[-5:0.01:5]
for i=length(t)
if t<0
y(i)=5;
else if t>0
y(i)=t^2;
end
end
end
this doesnt seem to work, it gave me an error that y is undefined. What did I do wrong
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Directed Graphs についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!