Variable Set by Non-scalar Properator??
조회 수: 1 (최근 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?
댓글 수: 0
답변 (1개)
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.
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!