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

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

 Réponse acceptée

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

2 commentaires

Also these changes:
y=(4*1i*(W.*cos(W) + sin(W)))./(W.^2);
Thanks!!

Connectez-vous pour commenter.

Plus de réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by