필터 지우기
필터 지우기

options for if else condition

조회 수: 1 (최근 30일)
Prashant Funde
Prashant Funde 2016년 8월 8일
편집: Walter Roberson 2016년 8월 8일
Hello sir, I have to use five slots but if two slots out of these five are free then as per users instruction randomly any one of these should be filled .
currently i am using it like as
if(c1 < 10)
s1 = ------------------
elseif (c2 < 80)
s2 = ------------------
elseif(c3 < 8)
s3 = ------------------
elseif(c4 < 8)
s4 = ------------------
elseif(c < 8)
s5 = ----------;
end
please suggest me any other conditional statement so that i can select any one of the slot randomly.
  댓글 수: 1
Walter Roberson
Walter Roberson 2016년 8월 8일
편집: Walter Roberson 2016년 8월 8일
What are the c* values? Are you trying to designate probabilities of selection? I notice that they do not add up to 100.

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Environment and Settings에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by