Skip to Main Content Skip to Search
File Exchange
MATLAB Newsgroup
Link Exchange
  Blogs  
 Contest 
MathWorks.com

Inside the MATLAB Desktop

July 23rd, 2007

Just give me a new line!

Typing several commands to run at the command line can be tedious and hard to read. After typing in several long commands, the text scrolls way over and it is hard to see exactly what has been typed. In the example below, I typed several commands to generate the quiver plot.

shiftenter1.jpg

To make the code easier to read and to make MATLAB wait while you type more commands, hit shift-enter as you enter commands. This adds a new line in the Command Window without executing the code that has already been typed. Another advantage of using shift-enter to type commands in the Command Window is that the commands are added to the Command History as separate commands instead of as one big command.

shiftenter2.jpg

This example is from the 3-D Demo, Quiver section.

5 Responses to “Just give me a new line!”

  1. Steve Eddins replied on :

    Hey, that’s a good one. I didn’t know about that!

  2. Markus replied on :

    If you change the grid in x or y in your example, you will have to repeat all the following commands one by one to get the plot updated. In my opinion it would be better to have all the lines as one big command in the command history.

  3. Kristin replied on :

    Markus - My example may not the best. I am sure there are times when one approach will be better than the other. I’m just trying to show that the option exists.

  4. Ravi replied on :

    This is an off topic question.
    Is it possible to just select a few variables of interest in the workspace browser window and hide the rest? This way, I can monitor and change them without getting distracted by the others.
    It would be nice to be able to at least drag the variables of interest to the top of the window.
    This is perhaps not a “must have” facility. I just felt that it would be convenient to have it.

  5. Kristin replied on :

    Hi Ravi,

    I’ve forwarded your comments to our developer for the Workspace browser to consider for a future release.

Leave a Reply


Inside the MATLAB Desktop is written by the MATLAB Interface teams.

Team picture
  • Etienne: Hello, Is it possible to change the background color of a particular cell?
  • Ken: No problem Mark…glad to help. Enjoy your font!
  • Mark Andrews: Ken, thanks for replying @3 and giving such clear instructions on how to get this to work.
  • Steve Eddins: Hi Ken, Every year or so I try to find a programming font that would really make me happy. A couple of...
  • Ken: @Jiro: Andale Mono looks nice! I especially like the rendering of the letter “g”.
  • Ken: Hi Mark, The issue your referring to (see the bug report here) was fixed in version 7.5 (R2007b). The problem...
  • Jiro: Ken, That’s a nice font. I use “Andale Mono” which has a similar look. I also like the clear...
  • Queffurust: This is my “cleanup” ; shortcut clc % clear Command Window close all hidden % deletes all...
  • Mark Andrews: Ken, should this work with version 7.0 (R14) on Windows? My favorite font is Consolas, but MATLAB seems...
  • Mark Feldman: Like Bryan (#38) and Kim (#40), I strongly request that you add native vi key bindings to the MATLAB...

These postings are the author's and don't necessarily represent the opinions of The MathWorks.

Related Topics