Hello, newbie here. Would like to ask how do you plot the output result of these code in a graph?
clear all;
syms x;
eu = exp(1);
g = 9.81;
c = 12.5;
m = 68.1;
format short;
f = (g*m/c) * (1 - eu ^ (-1 * (12.5/68.1) * x));
for x = 0:2:10
eval(subs (f))
end

回答 (1 件)

madhan ravi
madhan ravi 2018 年 12 月 16 日
編集済み: madhan ravi 2018 年 12 月 16 日

0 投票

Eval is evil also no loop is needed for your case.
clear all;
eu = exp(1);
g = 9.81;
c = 12.5;
m = 68.1;
x = 0:.2:10; % small increment to get a smoother curve
f = (g*m/c) .* (1 - eu .^ (-1 .* (12.5/68.1) .* x));
plot(x,f)

カテゴリ

ヘルプ センター および File Exchange2-D and 3-D Plots についてさらに検索

タグ

質問済み:

2018 年 12 月 16 日

編集済み:

2018 年 12 月 16 日

Community Treasure Hunt

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

Start Hunting!

Translated by