writting error meesage

1 view (last 30 days)
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

Accepted Answer

Oleg Komarov
Oleg Komarov on 30 May 2011
if r > 0.49
sprintf('The person is accepted.')
else error('The person is unccepted or not exist.')

More Answers (1)

Philip on 30 May 2011
try using the 'msgbox()' function:
if r > 0.49
disp('The person is accepted')
msgbox('The person is not accepted','An error has occurred','error')
See "doc msgbox" for more details.
  1 Comment
Taleb Almajrbi
Taleb Almajrbi on 30 May 2011
Accepted answer

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!

Translated by