Variable Set by Non-scalar Properator??

2 ビュー (過去 30 日間)
Kevin
Kevin 2014 年 7 月 30 日
回答済み: Star Strider 2014 年 7 月 30 日
Hi,
In my Matlab code I am using the following equations:
if axial_induction<0.4;
C_T=(sigma_local .* ((1-axial_induction).^2) .* ((Cl.*cos(relative_wind))+(Cd.*sin(relative_wind)))) ./ ((sin(relative_wind)).^2);
else
C_T=(8/9).*(4.*F-(40/9)).*axial_induction+((50/9)-4.*F).*(axial_induction.^2);
end
axial_induction is a 9x1 array of values. However I am getting an error stating that the variable 'axial_induction' might be set by a non-scalar operator. Can anybody please help me?

回答 (1 件)

Star Strider
Star Strider 2014 年 7 月 30 日
I’m not familiar with that error (never encountered it as you describe) but this might be what you want:
for k1 = 1:length(axial_induction)
if axial_induction(k1)<0.4;
C_T(k1)=(sigma_local .* ((1-axial_induction(k1)).^2) .* ((Cl.*cos(relative_wind))+(Cd.*sin(relative_wind)))) ./ ((sin(relative_wind)).^2);
else
C_T(k1)=(8/9).*(4.*F-(40/9)).*axial_induction(k1)+((50/9)-4.*F).*(axial_induction(k1).^2);
end
end
A guess here, but that is how I would do it.

カテゴリ

Help Center および File ExchangeSparse Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by