error:inner matrix dimensions must agree

hi.i'm getting this error.can you help me please? i attached the m-file

 採用された回答

Wayne King
Wayne King 2014 年 2 月 1 日

0 投票

The initial problem is coming from line 36:
Lm=((kc.^2).*(L1+L2)+sqrt((k2^4).*((L1+L2).^2)+4*(kc.^4)*(1-(kc.^2)).*L1.*L2))/(2.*(1-(kc.^2)));
in this part of the calculation:
4*(kc.^4)*(1-(kc.^2))
kc is 1x11 so you can multiply kc*kc, you have to multiply them element by element
Lm=((kc.^2).*(L1+L2)+sqrt((k2^4).*((L1+L2).^2)+4*(kc.^4).*(1-(kc.^2)).*L1.*L2))/(2.*(1-(kc.^2)));
You have similar problems in the next line though.

その他の回答 (1 件)

cagri
cagri 2014 年 2 月 1 日

0 投票

thanks a lot but i couldn't fix the problem.can you help a little more please?

2 件のコメント

Wayne King
Wayne King 2014 年 2 月 1 日
are you saying you did not understand how to fix the line I showed you, or you could not fix the error in the next line (where I indicated there was an error)
cagri
cagri 2014 年 2 月 1 日
i did not understand how to fix it,sir.if it is possible.can you show or send me the fixed code?thanks again for your interest..

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

タグ

質問済み:

2014 年 2 月 1 日

コメント済み:

2014 年 2 月 1 日

Community Treasure Hunt

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

Start Hunting!

Translated by