Borrar filtros
Borrar filtros

problem with 'if-elseif-else'

1 visualización (últimos 30 días)
mar vouz
mar vouz el 27 de Abr. de 2016
Editada: Stephen23 el 27 de Abr. de 2016
In order to show the appropriate root for the problem I created this code :
if riza > 1 | riza<0
fprintf('so the correct root is',root1)
elseif riza1>1 |riza1<0
fprintf ('so the correct root',root)
end
Even though it appears the message 'so the correct root is' ,it won't appear the root1 or root.How can this be fixed ?

Respuesta aceptada

KSSV
KSSV el 27 de Abr. de 2016
% code
if riza > 1 | riza<0
fprintf('so the correct root is %f\n',root1)
elseif riza1>1 |riza1<0
fprintf ('so the correct root %f \n',root)
end

Más respuestas (0)

Categorías

Más información sobre NaNs 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