필터 지우기
필터 지우기

multiple if elseif statement

조회 수: 1 (최근 30일)
Jibeom Hong
Jibeom Hong 2022년 12월 1일
답변: Rohit 2022년 12월 20일
How can solve this (using if and esleif statement)?
if lambda_theta <= 0
F_lambda_theta2 = 1 - ( (-12.986 * lambda_theta) -(123.66 * lambda_theta.^(2)) - (405.689 * lambda_theta.^(3)) ) * exp( -(Tu/1.5)^1.5 ) % lambda_theta2=<0
else
F_lambda_theta2 = 1 + 0.275 * ( 1 - exp( -35.0 * lambda_theta ) ) * exp ( -Tu/0.5 ) % lambda_theta2 > 0
end
% Re_theta2
if Tu <= 1.3
Re_theta2 = ( 1173.51 - 589.428 * Tu + ( 0.2196/(Tu^2) ) ) .* F_lambda_theta2
else
Re_theta2 = 331.50 * ( Tu - 0.5658 ) ^ (-0.671) * F_lambda_theta2
end
  댓글 수: 3
MarKf
MarKf 2022년 12월 1일
yeah you got it
Walter Roberson
Walter Roberson 2022년 12월 1일
is lambda_theta a scalar or potentially a vector?

댓글을 달려면 로그인하십시오.

답변 (1개)

Rohit
Rohit 2022년 12월 20일
You can refer to the below documentation links of if else statements’ to get you started with implementation. This also has some examples.
In order to get a better understanding of Element operations and array vs matrix operation and get clarity on the difference between them, you can refer to the below documentation links. Based on your use case, you can use either ‘*’ or ‘.* .

카테고리

Help CenterFile Exchange에서 Multidimensional Arrays에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by