If-else statement not working??
1 回表示 (過去 30 日間)
古いコメントを表示
Hi,
I am trying to calculate values of Ct before finding axial induction values for a 9x1 array using the following equations:
C_T=(sigma .* ((1-axial_induction).^2) .* ((Cl.*cos(relative_wind))+(Cd.*sin(relative_wind)))) ./ ((sin(relative_wind)).^2);
if C_T<=0.96
axial_induction=1 ./ (1+(4.*F.*(sin(relative_wind).^2)) ./ (sigma.*Cl.*cos(relative_wind)));
else
if C_T>0.96
axial_induction=1 ./ (((4.*F.*cos(relative_wind)) ./ (sigma.*Cl))-1);
end
end
However I am getting a warning which states that the variable CT might be set by a non scalar operator. I am unsure how to perform the if else statement for all entities inside the 9x1 vector? I researched a function call ismember but am unsure how to use it? Could anybody please help with this?
6 件のコメント
Jasmine
2014 年 7 月 16 日
So you want the if-statement to execute 9 times for each time Ct is changed? So that it can check each value in Ct against 0.96 and then set axial_induction accordingly? Does this mean that axial_induction should be a vector of length 9 as well?
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Particle & Nuclear Physics についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!