Matrix dimensions must agree error when using element operators
15 ビュー (過去 30 日間)
古いコメントを表示
I am confused on why I keep getting the error "Matrix dimensions must agree.". I am using element operators for the variable s_g=1.21.*WS./(g*rho.*TW).
C_Lmax=1.7;
g=32.2; % ft/s^2 %
rho=0.002377; % slugs/ft^3 %
% vectors %
TW=0.25:0.01:0.60;
WS=40:1:120;
% Matrices %
TWmat=meshgrid(0.25:0.01:0.60);
WSmat=meshgrid(40:1:120);
SGmat=meshgrid(TWMat,WSMat);
s_g=1.21.*WS./(g*rho.*TW);
0 件のコメント
採用された回答
Ameer Hamza
2020 年 10 月 14 日
Your variables
TW=0.25:0.01:0.60;
WS=40:1:120;
have a different number of elements. The element-wise operators require that all the vectors have equal length.
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Creating and Concatenating Matrices についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!