필터 지우기
필터 지우기

why this code not displaying else part

조회 수: 1 (최근 30일)
abdul rehman
abdul rehman 2020년 6월 7일
댓글: abdul rehman 2020년 6월 7일
the following code is only displaying the if part even if the value is less than 0.6
y = sprintf('%.1f',rand(1))
if y>0.6
disp('the value is false')
else
disp('true')
end

채택된 답변

madhan ravi
madhan ravi 2020년 6월 7일
Remove sprintf()
  댓글 수: 13
madhan ravi
madhan ravi 2020년 6월 7일
Thanks Steven.
abdul rehman
abdul rehman 2020년 6월 7일
thanks Steven this was the actural issue. and sorry madhan

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by