error:inner matrix dimensions must agree
조회 수: 5 (최근 30일)
이전 댓글 표시
hi.i'm getting this error.can you help me please? i attached the m-file
댓글 수: 0
채택된 답변
Wayne King
2014년 2월 1일
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.
댓글 수: 0
추가 답변 (1개)
cagri
2014년 2월 1일
댓글 수: 2
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)
참고 항목
카테고리
Help Center 및 File Exchange에서 Line Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!