Push button on a table
8 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hello. I'm having a problem with the push button. I opened and input dialog to ask how many rows I want in my table, and after that the table opens. The problem is that I want an OK button (or something like that), so after editing my table I can save that on a matrice to run some calculus. Is it possible to do that? Here is the what I've done yet.
% Number of rows
q = inputdlg('How many streams?');
% Opening figure
f = figure('Position', [125 125 400 400]);
% Creating uitable and editing it
t = uitable('Parent', f, 'Position', [25 25 350 350]);
set(t, 'ColumnName', {'Supply|Temperature|(°C)', 'Target|Temperature|(°C)', 'dT Min|(°C)', 'Heat Duty|(kW)'});
set(t, 'Data', zeros(str2double(q{1}),4));
set(t, 'ColumnEditable', [true true true true true])
Thanks.
0 Kommentare
Akzeptierte Antwort
Robert Cumming
am 28 Jul. 2011
something like:
uicontrol ( 'parent', f, 'style', 'pushbutton', 'position', [25 0 350 20], 'string', 'PUSH', 'Callback', {@MyCallBack} )
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Creating, Deleting, and Querying Graphics Objects finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!