Push button on a table
8 views (last 30 days)
Show older comments
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 Comments
Accepted Answer
Robert Cumming
on 28 Jul 2011
something like:
uicontrol ( 'parent', f, 'style', 'pushbutton', 'position', [25 0 350 20], 'string', 'PUSH', 'Callback', {@MyCallBack} )
0 Comments
More Answers (0)
See Also
Categories
Find more on Creating, Deleting, and Querying Graphics Objects in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!