why this code not displaying else part

1 visualización (últimos 30 días)
abdul rehman
abdul rehman el 7 de Jun. de 2020
Comentada: abdul rehman el 7 de Jun. de 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

Respuesta aceptada

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

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Get Started with MATLAB en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by