If-else statement not working??
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Jasmine
le 16 Juil 2014
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?
Réponses (0)
Voir également
Catégories
En savoir plus sur Particle & Nuclear Physics dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!