how to display the result of a function in table GUI ??

4 ビュー (過去 30 日間)
ElizabethR
ElizabethR 2016 年 6 月 14 日
コメント済み: ElizabethR 2016 年 6 月 14 日
i have a function. The function name zernikeuji3.The function is called form pushbutton2 and get the parameters from popupmenu1. So,when i call the function, it is generate some value. i want to show the result of the function in a table 1 like in image that i attach. But, why the result is show in new table ( table 2 like in image that i attach ).
here my code
function pushbutton2_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global image1
contents=get(handles.popupmenu1,'String');
popupmenu1_value=contents{get(handles.popupmenu1,'Value')};
switch popupmenu1_value
case '0'
a=cast(zernikeuji3(image1,0),'single')
table_as_cell = num2cell(a);
set(uitable, 'Data', table_as_cell);
case '1'
a=cast(zernikeuji3(image1,1),'single')
table_as_cell = num2cell(a);
set(uitable, 'Data', table_as_cell);
end
how to make it ? need help. Thanks

採用された回答

Geoff Hayes
Geoff Hayes 2016 年 6 月 14 日
eliz - you need to reference the table that you wish to update and not create a new one. Your code
set(uitable, 'Data', table_as_cell);
will create a new uitable and set its data as table_as_cell. You need to use the handle of the table (in your GUI) instead as
set(handles.uitable1, 'Data', table_as_cell);
The name (or tag) for your uitable is probably something similar to uitable1, so you need to use its handle when you want to update the data for that table.
  1 件のコメント
ElizabethR
ElizabethR 2016 年 6 月 14 日
hi Geoff Hayes, oouuh yes, you are right. thanks you so much. God Bless You :)

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMigrate GUIDE Apps についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by