Results 1 to 2 of 2

Math Help - print text along with variable value

  1. #1
    Newbie
    Joined
    Apr 2010
    Posts
    23

    print text along with variable value

    Code:
    function one()
    x=3;
    disp(x)
    
    
    end
    in the above code the output is

    3

    how can i get it as

    value of x is 3

    please help
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Member
    Joined
    Mar 2007
    Posts
    206
    Awards
    1
    Something like this:

    Code:
    EDU>> x = 3;
    EDU>> fprintf('value of x is %i\n',x)
    value of x is 3
    EDU>>
    Elbarto
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Replies: 0
    Last Post: September 30th 2011, 03:07 AM
  2. ArXiv.org pre-print server
    Posted in the Math Forum
    Replies: 0
    Last Post: March 23rd 2011, 08:52 PM
  3. Cannot print an accent character in TeXnicCenter
    Posted in the LaTeX Help Forum
    Replies: 3
    Last Post: May 19th 2009, 02:30 AM
  4. Rules for Pre-Print Forum
    Posted in the Peer Math Review Forum
    Replies: 0
    Last Post: February 24th 2009, 03:36 AM
  5. Under text
    Posted in the LaTeX Help Forum
    Replies: 3
    Last Post: June 11th 2008, 11:02 PM

Search Tags


/mathhelpforum @mathhelpforum