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?

조회 수: 4 (최근 30일)
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

채택된 답변

Jan
Jan 2011년 9월 18일
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

댓글을 달려면 로그인하십시오.

추가 답변 (3개)

Fangjun Jiang
Fangjun Jiang 2011년 9월 18일
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
Fangjun Jiang
Fangjun Jiang 2011년 9월 18일
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.

댓글을 달려면 로그인하십시오.


TAB
TAB 2011년 9월 18일
I don't think it is possible. There is no such command line function.
  댓글 수: 6

댓글을 달려면 로그인하십시오.


Image Analyst
Image Analyst 2011년 9월 18일
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
mohammad
mohammad 2011년 9월 18일
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
Image Analyst
Image Analyst 2011년 9월 18일
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.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Desktop에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by