why this code not displaying else part

1 次查看(过去 30 天)
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 个评论
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