Hi!
I want to make a function of x.
This is my code:
x=(0:0.001:5); %x-values
f=2*x*exp(-x);
plot(x,f)
But MatLab is telling me:
Error using *
Inner matrix dimensions must agree.
What does this mean in this case and how do I solve it?

답변 (1개)

Walter Roberson
Walter Roberson 2016년 1월 23일

0 개 추천

f=2*x.*exp(-x);

카테고리

도움말 센터File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

태그

질문:

2016년 1월 23일

댓글:

2016년 1월 23일

Community Treasure Hunt

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

Start Hunting!

Translated by