Results 1 to 2 of 2

Math Help - Matlab Msgbox Help

  1. #1
    Newbie
    Joined
    Apr 2010
    Posts
    1

    Matlab Msgbox Help

    I am trying to get the variable 'score' to appear after 'Your score was' in the 'ABC' msgbox. How do I do this?
    Here is my code:

    %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
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Member
    Joined
    Mar 2007
    Posts
    206
    Awards
    1
    Try something like:

    Code:
    ABC=msgbox(['You are a tv expert. Your score was ' num2str(score)]);
    Elbarto
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. ode 45 (matlab)
    Posted in the Math Software Forum
    Replies: 3
    Last Post: October 8th 2010, 01:30 PM
  2. Matlab Help
    Posted in the Math Software Forum
    Replies: 1
    Last Post: April 17th 2010, 09:13 AM
  3. i need help in matlab
    Posted in the Math Software Forum
    Replies: 0
    Last Post: March 2nd 2010, 08:49 PM
  4. help with matlab please
    Posted in the Math Software Forum
    Replies: 1
    Last Post: May 7th 2009, 11:51 PM
  5. MATLAB
    Posted in the Math Software Forum
    Replies: 4
    Last Post: September 25th 2008, 02:47 PM

Search Tags


/mathhelpforum @mathhelpforum