Filter löschen
Filter löschen

why this code not displaying else part

1 Ansicht (letzte 30 Tage)
abdul rehman
abdul rehman am 7 Jun. 2020
Kommentiert: abdul rehman am 7 Jun. 2020
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

Akzeptierte Antwort

madhan ravi
madhan ravi am 7 Jun. 2020
Remove sprintf()
  13 Kommentare
madhan ravi
madhan ravi am 7 Jun. 2020
Thanks Steven.
abdul rehman
abdul rehman am 7 Jun. 2020
thanks Steven this was the actural issue. and sorry madhan

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Get Started with MATLAB finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by