Create a "Copy-Button" in MATLAB GUI
4 views (last 30 days)
Show older comments
Hi,
i created a Matlab GUI and I need to add a button to copy the data that is presented in the uitable.
I need to create a matrix that contains als the three-dimensional ponits. So it needs to look like the uitable that in the attached fig-file, but the columns are seperated by comma.
I hope that somebody knows what I am looking for.
Thnaks in advance.
0 Comments
Answers (1)
Voss
on 14 Feb 2023
(I modified your m-file to include pushbutton_Callback and pushbutton2_Callback in the handles structure so I could run those functions here in the Answers forum.)
h = bachelor;
handles = guidata(h);
handles.pushbutton_Callback(handles.figure1,[],handles) % same as clicking the "Calculate" button
I added a single line to pushbutton2_Callback, which is "get(handles.table1,'Data')", so that when the "Copy Data" button is pushed the contents of the uitable are displayed in the command window.
handles.pushbutton2_Callback(handles.figure1,[],handles) % same as clicking the "Copy Data" button
It sounds like that's the matrix you want to create.
Do you want to do something else with it?
3 Comments
See Also
Categories
Find more on Environment and Settings in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!