MATLAB Answers

Tianna
0

I am trying to plot y=x^2sin(x), where x is from 0 to 2pi. I have defined x using the linspace command, but matlab does not agree with the (x.^2) part. Is there a concept I am missing?

Asked by Tianna
on 3 Sep 2012
Latest activity Answered by Ernesto Martinez on 22 Apr 2019
>> x=linspace(0,2*pi);
>> y=(x.^2)*sin(x);
Error using *
Inner matrix dimensions must agree.

  0 Comments

Sign in to comment.

1 Answer

Answer by Ernesto Martinez on 22 Apr 2019
 Accepted Answer

y= (x.^2).*sin(x.^-1);

  0 Comments

Sign in to comment.