1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Homework Help: MATLAB message box help

  1. Apr 28, 2010 #1
    1. The problem statement, all variables and given/known data
    In the ABC msgbox I would like the variable 'score' to appear after 'Your score was'. How do I do this?

    2. Relevant equations
    %tells the user their overall tv knowledge
    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 ');
  2. jcsd
  3. Apr 29, 2010 #2
    Try this:

    ABC = msgbox(['You are a tv expert. Your score was ', num2str( score )] );
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook