Azzera filtri
Azzera filtri

why this code not displaying else part

1 visualizzazione (ultimi 30 giorni)
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

Risposta accettata

madhan ravi
madhan ravi il 7 Giu 2020
Remove sprintf()
  13 Commenti
abdul rehman
abdul rehman il 7 Giu 2020
thanks Steven this was the actural issue. and sorry madhan

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Get Started with MATLAB in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by