writting error meesage

Hello how can i write code to print message my answer is:
if r > 0.49 sPrintf('the person is accepted.'); else error('the person is unccepted or not exist.') end;
please correct my answer
thanks

 Respuesta aceptada

Oleg Komarov
Oleg Komarov el 30 de Mayo de 2011

1 voto

if r > 0.49
sprintf('The person is accepted.')
else error('The person is unccepted or not exist.')
end

Más respuestas (1)

Philip
Philip el 30 de Mayo de 2011

1 voto

try using the 'msgbox()' function:
ie.
if r > 0.49
disp('The person is accepted')
else
msgbox('The person is not accepted','An error has occurred','error')
end
See "doc msgbox" for more details.

Categorías

Más información sobre Communications Toolbox en Centro de ayuda 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