%if true
% code
%end
x = linspace(-0.02,0.02);
y = -(2.56*10^10)*x;
plot(x,y)
title('\sigma_{xx}')
r=linspace(-0.02,0.02);
s=(2.56*10^6)-(6.4*10^9)*(r^2);
plot(r,s)
title('\sigma_{xy}')
I want to plot these two graphs but for the second graph, there is error for some reason

 採用された回答

KSSV
KSSV 2020 年 11 月 9 日

0 投票

Read about element by element operations.
x = linspace(-0.02,0.02);
y = -(2.56*10^10)*x;
plot(x,y)
title('\sigma_{xx}')
r=linspace(-0.02,0.02);
s=(2.56*10^6)-(6.4*10^9)*(r.^2); % change here use .^
plot(r,s)
title('\sigma_{xy}')

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeLine Plots についてさらに検索

タグ

質問済み:

2020 年 11 月 9 日

回答済み:

2020 年 11 月 9 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by