Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

MatLab display question

  1. Sep 12, 2004 #1
    I gott add spaces into this output, how in sweet gods name do i do this? Here is my code:

    disp( '' )
    disp( 'Solution to workshop 5, exercise 3 ')
    disp( 'Calculate the volume of a piece of iron by determining the amount of')
    disp( 'water displaced as it is submerged.')



    Thanks
     
  2. jcsd
  3. Sep 12, 2004 #2

    enigma

    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    I'm confused what you're asking for...

    what do you want the output to look like?
     
  4. Sep 12, 2004 #3
    Well when it's displayed.. it looks like this:

    Solution to workshop 5, exercise 3
    Calculate the volume of a piece of iron by determining the amount of
    water displaced as it is submerged.

    I want it to look like this:

    Solution to workshop 5, exercise 3

    Calculate the volume of a piece of iron by determining the amount of

    water displaced as it is submerged.

    ---with space(s) inbetween the lines. I can't figure out how to do this
     
  5. Sep 13, 2004 #4

    enigma

    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    Try this:

    Code (Text):

    for a=1
       disp('a')
       disp(' ')
       disp(' ')
       disp('b')
    end
     
    It should output
    Code (Text):

    a


    b
     
     
  6. Sep 13, 2004 #5
    AH! Score. Thanks man, it's workin now!
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?
Similar Discussions: MatLab display question
  1. Matlab question (Replies: 10)

Loading...