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!