How to Display the Score in MATLAB Message Box for Your TV Knowledge

  • Thread starter Thread starter cmajor47
  • Start date Start date
  • Tags Tags
    Box Matlab
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
1 reply · 7K views
cmajor47
Messages
53
Reaction score
0

Homework Statement


In the ABC msgbox I would like the variable 'score' to appear after 'Your score was'. How do I do this?


Homework Equations


%tells the user their overall tv knowledge
score=A+B+C;
title1='Your TV Knowledge';
if ((A+B+C)<=24)&&((A+B+C)>=18)
ABC=msgbox('You are a tv expert. Your score was ');
elseif ((A+B+C)<18)&&((A+B+C)>=9)
ABC=msgbox('You know a lot about your favorite shows, but don''t know that much about others. Your score was ');
elseif ((A+B+C)<9)&&((A+B+C)>=0)
ABC=msgbox('You rarely watch tv. You need to brush up on your tv knowledge. Your score was ');
end
 
Physics news on Phys.org
Try this:

ABC = msgbox(['You are a tv expert. Your score was ', num2str( score )] );