Push button on a table

8 次查看(过去 30 天)
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.

采纳的回答

Robert Cumming
Robert Cumming 2011-7-28
something like:
uicontrol ( 'parent', f, 'style', 'pushbutton', 'position', [25 0 350 20], 'string', 'PUSH', 'Callback', {@MyCallBack} )

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Creating, Deleting, and Querying Graphics Objects 的更多信息

标签

产品

Community Treasure Hunt

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

Start Hunting!

Translated by