If-else statement not working??
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Jasmine
el 16 de Jul. de 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?
Respuestas (0)
Ver también
Categorías
Más información sobre Particle & Nuclear Physics en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!