Why does it give an error?

1 回表示 (過去 30 日間)
Zeynep Akyazici
Zeynep Akyazici 2022 年 5 月 7 日
編集済み: Image Analyst 2022 年 5 月 8 日
B=[3.0000 4.0000 5.0000 6.0000 7.0000 8.1000 9.0000 10.0000 11.0000 12.0000 16.0000];
f=[0.0067 0.0077 0.0088 0.0098 0.0109 0.0120 0.0130 0.0141 0.0152 0.0162 0.0173];
V9=[323.7612 321.5724 319.4098 317.2738 315.1648 311.0602 311.0294 309.0038 307.0070 305.0393 232.7858];
[a b c]=meshgrid(B f V9);
X=((a./(a+1)).*360.265)+((1./(1+a)).*(1+b).*c)-296.5+62.77;
Y=(b./X);
o = carpetplot(a,b,c,X,Y);
xlabel('Specific Thrust kg/N.s')
ylabel('TSFC N.s/kg')
grid on;
Invalid expression. Check for missing multiplication operator, missing or unbalanced delimiters, or other syntax error.
To construct matrices, we need to use brackets instead of parentheses.
Why?

回答 (1 件)

Voss
Voss 2022 年 5 月 7 日
B, f, and V9 need to be passed to meshgrid as three separate arguments, separated by commas:
B=[3.0000 4.0000 5.0000 6.0000 7.0000 8.1000 9.0000 10.0000 11.0000 12.0000 16.0000];
f=[0.0067 0.0077 0.0088 0.0098 0.0109 0.0120 0.0130 0.0141 0.0152 0.0162 0.0173];
V9=[323.7612 321.5724 319.4098 317.2738 315.1648 311.0602 311.0294 309.0038 307.0070 305.0393 232.7858];
% [a b c]=meshgrid(B f V9);
[a b c]=meshgrid(B,f,V9);

カテゴリ

Help Center および File ExchangeMultidimensional Arrays についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by