How to recall previous commands... and ADD them to what you've already typed.

16 views (last 30 days)
I know that the up arrow allows you to recall previous commands you've used. It replaces the contents of the current command line with those previous commands.
I also know that you can also get partial matches by typing and then using the up arrow. For example, if you used the command "plot(x,y)" five commands ago, you can type "plot" and hit the up arrow, and it will cycle through previous commands that start with "plot".
What I want to do is ADD previous commands to what I've already typed in the command line. For example, my previous command is "A*B". Now I want to plot that. If I type "plot(" and hit the up arrow, the "plot(" is REPLACED with "A*B". I want to type "plot(" and hit some key so that I get "plot(A*B".
I feel like I've seen people do this before, but I can't seem to figure out how.
PS: I know A*B is easy to type, but this often happens with long expressions that I don't want to retype. I also know that I could hit the up arrow, then add the "plot(" to the beginning, but that's also a pain.

Answers (1)

Image Analyst
Image Analyst on 23 Oct 2014
Just hit up arrow or paste to get the code on the command line, then use the right and left arrows or mouse/cursor to put the insertion point where you want and start typing in your new stuff. You can also delete characters also. When it looks the way you want it then hit the enter key.
  1 Comment
Travis
Travis on 23 Oct 2014
I mentioned this solution in the PS. It's a workaround, but I really want the functionality I mentioned, if it's possible... there are a lot of times where it would could in handy to be able to add previous statements to what I've already typed.

Sign in to comment.

Categories

Find more on Desktop in Help Center and File Exchange

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!