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?

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

2 Commenti

edit
sorry there was a wrong of typing
i mean scroll bar of command window not goes up or down after 'clc' or running a m-file

Accedi per commentare.

 Risposta accettata

You could display the links by using an HTML document shown in the built-in browser, see the WEB command. Inside this browser, hyperlinks like this are evaluated in MATLAB:
<matlab:plot(rand(10)) Plot(rand(10))>
They can be displayed in a nice table also. And most of all: There is not auto-scrolling in the browser. It is simple a good idea to separate the standard output to the command window and the GUI.
[EDITED]: You can try this to create a HTML file, which can be displayed in the browser: FEX: cell2html
cell2html({'<matlab:plot(rand(10)) Plot(rand(10))>'}, 'Test.html');
web('Test.html');

4 Commenti

thanks a lot, could you tell me how i can make a table in this browser?
for example what must do i if i want to put all of these in one browser?
<a href="matlab:plot(rand(10))">Plot(rand(10))</a>
<a href="matlab:plot(rand(9))">Plot(rand(9))</a>
<a href="matlab:plot(rand(8))">Plot(rand(8))</a>
and how can i put all hyperlink arrays of a cell in one browser?
i did this but doesn't work:
for i=1:size(RESULT,1)-1 % except of first column and first row, other arrays are hyperlinks
for j=1:size(RESULT,2)-1
web(RESULT{i+1,j+1})
end
end
Great!Perfect!
this is the same thing I need
thanks a lot

Accedi per commentare.

Più risposte (3)

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 Commenti

"using or relying on Command Window display to implement the user interface of your program is not a good idea." I wholeheartedly agree.
so thanks Fangjun
please give me an example
i studied 'uitable' . i use in this form:t = uitable('Data',CELL)
that CELL has all names of .xls file and all hyper-links
but in that figure arrays are not hyperlink or linkable
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.

Accedi per commentare.

I don't think it is possible. There is no such command line function.

6 Commenti

thanks
i think there is a command in matlab do this. for example when we enter 'clc' it goes first after cleaning
i fund this command too:'home' that moves:
"home moves the cursor to the upper-left corner of the Command Window. You can use the scroll bar to see the history of previous functions"
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.
thanks Fangjun
I have a cell that arrays of it are hyperlink and when i click on them, a figure is plotted. after plotting, scroll bar goes to end and then i must up it to the next array.( these arrays are more than 40000 and it's too hard to finde next array again after scroll bar coming down)

Accedi per commentare.

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 Commenti

dear there is no command
I have a cell that arrays of it are hyperlink and when i click on them, a figure is plotted
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?
all this are happening in command window. but commands not typed even command are in an m-file and some hyperlinks are in command widow that by clicking on them, this m-file runs and after that, scroll bar of command window go down to end
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.

Accedi per commentare.

Categorie

Community Treasure Hunt

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

Start Hunting!

Translated by