필터 지우기
필터 지우기

MATLAB GUI

조회 수: 2 (최근 30일)
ANUBHAV SINHA
ANUBHAV SINHA 2011년 1월 28일
Hi
It is intended that on basis of the number of rows and columns inputted by user, MATLAB should itself construct a tabular GUI in which numbers could be entered and thereafter, on pushing a 'push-button', some other specified job is execute. Any idea about how to 'auto'-generate a table in GUI?
Having constructed some straight forward GUIs using GUIDE (and thereafter programming it's m-files), I am relatively new and hav no clue abt this problem.
Thanks for your time.
  댓글 수: 1
Siddharth Shankar
Siddharth Shankar 2011년 1월 30일
It is a good idea to provide more descriptive titles for your questions, such as "How to use a table in a MATLAB GUI (R2007a)".

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

답변 (5개)

Siddharth Shankar
Siddharth Shankar 2011년 1월 30일
As Matt mentioned, UITABLE wasn't really supported/documented till R2008a and was not (in 7a) nearly as powerful as it is today. There are plenty of workarounds:
There are also plenty of posts about this on the Newsgroup. One such post is here:
Most of these are undocumented/unsupported solutions, but should enable you to do what you need in R2007a. Best of luck.
  댓글 수: 1
Siddharth Shankar
Siddharth Shankar 2011년 1월 30일
Just to clarify, with the 2nd link (the one alluding to the javacomponent command), I was trying to say that you should try using a JTABLE in your MATLAB figure if you're comfortable with Java.

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


Matt Fig
Matt Fig 2011년 1월 28일
Would UITABLE be what you want?

Walter Roberson
Walter Roberson 2011년 1월 28일
This would sound like a job for uitable(), if you are using a version new enough to have a documented uitable() . Which Matlab version are you using?

ANUBHAV SINHA
ANUBHAV SINHA 2011년 1월 30일
Version 7.4.0 R2007a

Matt Fig
Matt Fig 2011년 1월 30일
UITABLE was available in 2007a, for example:
T = uitable('NumColumns',4,'NumRows',6,'position',[10 10 400 300]);
Now to see the properties of T, try get(T). Beware that this was experimental back then and has changed. Even some of the property names have changed. Here is the current documentation.
Another option would be to create an array of editable textboxes, if the expected number of rows and columns is not too large (or could be programatically limited).
figure('position',[400 400 120 120],...
'menubar','none')
P = [10 10 45 20];
for ii = 1:2
for jj = 1:3
T(ii) = uicontrol('style','edit',...
'position',P + [55*(ii-1) 40*(jj-1) 0 0]);
end
end

카테고리

Help CenterFile Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by