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

remove the ^ and .^ just exp(something)
Hi W
Thank you! It's right.
but I don't know why the graph is wrong.
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일
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);

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Numerical Integration and Differentiation에 대해 자세히 알아보기

태그

질문:

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