MATLAB: Error using ==> mtimes Inner matrix dimensions must agree.

errormtimes

Can anyone help me how to fix this error?
W=[-1:0.01:1];
y=(4*1i*(W*cos(W) + sin(W)))/(W^2);

Best Answer

Use ./ instead of /
y=(4*1i*(W*cos(W) + sin(W)))./(W^2);