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);

 採用された回答

Azzi Abdelmalek
Azzi Abdelmalek 2016 年 4 月 25 日

1 投票

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

2 件のコメント

Roger Stafford
Roger Stafford 2016 年 4 月 25 日
Also these changes:
y=(4*1i*(W.*cos(W) + sin(W)))./(W.^2);
Lucas Périco
Lucas Périco 2016 年 4 月 28 日
Thanks!!

サインインしてコメントする。

その他の回答 (0 件)

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by