Help with "Error using / Matrix dimensions must agree."
조회 수: 1 (최근 30일)
이전 댓글 표시
Hi,
So my code looks like:
---------------------------------------------------
Air_desnity=[0.646:0.01:1.225];
W_412_MTOW=5534;
A_412=153.93804;
Power_412=(W_412_MTOW*9.81)^3/(2*Air_desnity*A_412).^0.5
--------------------------------------------------------------
And the error is:
Error using /
Matrix dimensions must agree.
Error in Power (line 6)
Power_412=(W_412_MTOW*9.81)^3/(2*Air_desnity*A_412).^0.5
------------------------------------------------------------------------------------------------
Could someone explain what the error means I tried following it and applying the steps but it doesn't make any sense to me
댓글 수: 0
채택된 답변
Star Strider
2023년 6월 14일
Use element-wise division, so (./) instead of (/) —
Air_desnity=[0.646:0.01:1.225];
W_412_MTOW=5534;
A_412=153.93804;
Power_412=(W_412_MTOW*9.81)^3./(2*Air_desnity*A_412).^0.5
.
추가 답변 (1개)
Satwik
2023년 6월 14일
In order to perform elementwise division you should use ./ instead of /
Air_desnity=[0.646:0.01:1.225]
W_412_MTOW=5534;
A_412=153.93804;
Power_412=(W_412_MTOW*9.81)^3./(2*Air_desnity*A_412).^0.5
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!