is it possible to make command window scroll bar being in position of it self even by runnig a m-file and not going end of wondow?
Show older comments
Is it possible to make command window scroll bar being in position of it self even by running a m-file and not going end of window? I want to control scroll bar of command window manually only for a special and specified m-file
Accepted Answer
More Answers (3)
Fangjun Jiang
on 18 Sep 2011
1 vote
I am not aware a method to control the Command Window scroll bar position through M programming. You could press ctrl-home to quickly go to the top of the command history.
So you could run a clc command, then run your program to display all the hyper-links. A user can press any of the hyper-links to plot a figure or do anything. The Command Window display will move due to the outputs of those plotting. Then the user can press ctrl-home to go back to the original display of all those hyper-links.
The problem is, with so many hyper-links, it's still hard to find the right one. Plus, once the "Number of lines in command window scroll buffer" (default is 5000 but it is configurable) is hit, I don't think you can go back to the original hyper-links anymore.
The point is, using or rely on Command Window display to implement the user interface of your program is not a good idea. You could use uitable(). You could put all the Excel file names in a cell array and use uitable() to display it in a dedicated window. In the callback function of the uitable, you can implement the function that was in your hyper-link to do the plotting or whatever else.
4 Comments
Image Analyst
on 18 Sep 2011
"using or relying on Command Window display to implement the user interface of your program is not a good idea." I wholeheartedly agree.
mohammad
on 18 Sep 2011
Fangjun Jiang
on 18 Sep 2011
uitable() changed a lot between versions. In R2007b, it is 'undocumented'. You can type doc uitable or check this link for details. http://www.mathworks.com/help/techdoc/ref/uitable.html
Hyper-link won't work anymore. You'll need to set up a callback function. Every time a cell in the table is clicked, the function will be called. In this function, you'll read the content of the cell (the Excel file name) and then load the data and plot. Since you've already have that part done, I don't think you need much coding change.
mohammad
on 19 Sep 2011
TAB
on 18 Sep 2011
0 votes
I don't think it is possible. There is no such command line function.
6 Comments
mohammad
on 18 Sep 2011
mohammad
on 18 Sep 2011
Fangjun Jiang
on 18 Sep 2011
Yes, that is true. 'home' will move the cursor to the top without clear history. What is your use case? I am curious to know why do you need to control the position of the scroll bar of the Command Window.
mohammad
on 18 Sep 2011
Fangjun Jiang
on 18 Sep 2011
Okay, I see your need!
mohammad
on 18 Sep 2011
Image Analyst
on 18 Sep 2011
0 votes
You don't have to scroll all the way up past 40000 lines of output to get to the last typed commands. Just hit the up arrow to get the previous command(s). You can also type a few characters of the prior command and then hit up arrow and it will bring up only those that start with those characters.
4 Comments
mohammad
on 18 Sep 2011
Image Analyst
on 18 Sep 2011
You said "command window scroll bar". If that's not true, then say exactly what your scroll bar is attached to. A listbox? An edit text box? What?
mohammad
on 18 Sep 2011
Image Analyst
on 18 Sep 2011
Then make a GUI and have your links be in one place, like a listbox or uitable, and send your output to an edit text box where you can scroll around.
Categories
Find more on Desktop in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!