MATLAB GUI

1 visualizzazione (ultimi 30 giorni)
ANUBHAV SINHA
ANUBHAV SINHA il 28 Gen 2011
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 Commento
Siddharth Shankar
Siddharth Shankar il 30 Gen 2011
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)".

Accedi per commentare.

Risposte (5)

Siddharth Shankar
Siddharth Shankar il 30 Gen 2011
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 Commento
Siddharth Shankar
Siddharth Shankar il 30 Gen 2011
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.

Accedi per commentare.


Matt Fig
Matt Fig il 28 Gen 2011
Would UITABLE be what you want?

Walter Roberson
Walter Roberson il 28 Gen 2011
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 il 30 Gen 2011
Version 7.4.0 R2007a

Matt Fig
Matt Fig il 30 Gen 2011
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

Categorie

Scopri di più su Migrate GUIDE Apps in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by