Author Topic: Error In code, Can anyone help!?  (Read 732 times)

Offline hitmen

  • Newbie
  • *
  • Posts: 1
  • Matlab Forum
    • View Profile
Error In code, Can anyone help!?
« on: August 24, 2011, 04:46:17 AM »
:'( %I am supposed to plot a sinc function%
 
xx= [-5:0.1:5];
size(xx);
yy=sin(pi*xx)./(pi*xx);
yy(51)= 1.0;
plot(xx,yy^2);grid;
 
 
??? Error: File: pg30.m Line: 4 Column: 13
Unbalanced or unexpected parenthesis or bracket.
 
??? Error using ==> mpower
Matrix must be square.
Error in ==> pg30 at 8
plot(xx,yy^2);grid;
??? Error using ==> mpower
Matrix must be square.
Error in ==> pg30 at 8
plot(xx,yy^2);grid;
??? Undefined function or method 'mtimes' for input arguments of type 'cell'.
Error in ==> pg30 at 6
yy=sin(pi*xx)./(pi*xx);
 
??? Undefined function or method 'mtimes' for input arguments of type 'cell'.
Error in ==> pg30 at 6
yy=sin(pi*xx)./(pi*xx);
 
??? Error using ==> mpower
Matrix must be square.
Error in ==> pg30 at 8
plot(xx,yy^2);grid;

Matlab and SimuLink Development Forum

Error In code, Can anyone help!?
« on: August 24, 2011, 04:46:17 AM »