jonprasetyo
jonprasetyo

Reputation: 3586

Cannot plot graph in Matlab '??? Error using ==> mtimes' (Inner matrix dimensions must agree.)

when i type this equation in MatLab, I get the following error:

x=linspace(0,8*pi,1000);
y=x*sin(x);

??? Error using ==> mtimes
Inner matrix dimensions must agree.

Thank you very much!

Upvotes: 0

Views: 2545

Answers (1)

Pete
Pete

Reputation: 2344

Your question has nothing to do with plotting.

But you want element-wise multiplication. e.g., .* instead of *

x=linspace(0,8*pi,1000); y=x.*sin(x);

http://stuff.mit.edu/afs/sipb/project/www/matlab/imatlab/node10.html

Upvotes: 2

Related Questions