how can I write this exponential function and plot it in matlab?

I want to write this function in matlab,but always wrong.
y=[(-14)*e^( -1500*x )]+[26*e^(-20000*x)]
I written as
y=(-14)*exp.^( -1500*x )+26*exp^(-20000*x)
I don't know where was wrong.
and I want to plot this function.

4 件のコメント

Walter Roberson
Walter Roberson 2021 年 6 月 28 日
remove the ^ and .^ just exp(something)
G G
G G 2021 年 6 月 28 日
Hi W
Thank you! It's right.
but I don't know why the graph is wrong.
KSSV
KSSV 2021 年 6 月 28 日
Show us your complete attempt.
G G
G G 2021 年 6 月 28 日
編集済み: G G 2021 年 6 月 28 日
Hi K ,this is my complete attempt.
y=(-14)*exp(-1500*x )+26*exp(-20000*x)
plot(x,y)

サインインしてコメントする。

 採用された回答

Mathieu NOE
Mathieu NOE 2021 年 6 月 28 日

0 投票

hello
don't forget to define x if you want an output :
x = linspace(0,0.005,500);
y=(-14)*exp(-1500*x )+26*exp(-20000*x);
plot(x,y);

1 件のコメント

G G
G G 2021 年 6 月 28 日
Hi,
Oh,I know what the problem is!
thank you!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

タグ

質問済み:

G G
2021 年 6 月 28 日

コメント済み:

G G
2021 年 6 月 28 日

Community Treasure Hunt

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

Start Hunting!

Translated by