Help with "Error using / Matrix dimensions must agree."
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Dan Giffin
el 14 de Jun. de 2023
Comentada: Star Strider
el 14 de Jun. de 2023
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 comentarios
Respuesta aceptada
Star Strider
el 14 de Jun. de 2023
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
.
2 comentarios
Más respuestas (1)
Satwik
el 14 de Jun. de 2023
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 comentarios
Ver también
Categorías
Más información sobre Logical en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!