MATLAB Answers

Export Table from Matlab Guide to Excel

12 views (last 30 days)
Miss B
Miss B on 25 Mar 2020
Commented: Adam Danz on 27 Mar 2020
Hello everyone!
I am having serious trouble trying to export a TABLE from MATLAB GUIDE to EXCEL with a PUSH BUTTON.
How would I go about coding this exactly under a push button?
And under which function would I code this under?
Thank you very much for your help!
Adam Danz
Adam Danz on 27 Mar 2020
@Miss B, please understand why it was important to confirm that the entire error message was shared because this will help you troubleshoot in the future. Below is a typical, complete error message produced from within a GUIDE GUI named save_table. The error message you shared only contained the last 5 lines but critical information is in the first few lines which seemed to have been missing from the error message you shared.
Also notice that the error message you shared doesn't mention xlswrite at all. So, it must be the case that either 1) the error wasn't caused by xlswrite or 2) parts of the error message was missing. Or, maybe you resolved that error on your own and were having a different problem that wasn't communicated effectively.
We can't suggest solutions before we understand the problem and I know it's often difficult to explain the problem (it's like me describing the sounds my car's making to the mechanic).
Not enough input arguments. % <-- %
Error in save_table>pushbutton1_Callback (line 85) % <-- This part seems %
cla(handles.axes1) % <-- to be missing %
Error in gui_mainfcn (line 95) % <-- from your error %
feval(varargin{:}); % <-- message. %
Error in save_table (line 19)
gui_mainfcn(gui_State, varargin{:});
Error in>@(hObject,eventdata)save_table('pushbutton1_Callback',hObject,eventdata,guidata(hObject))
Error while evaluating UIControl Callback.

Sign in to comment.

Accepted Answer

Sean de Wolski
Sean de Wolski on 26 Mar 2020
This would be a lot easier in App Designer because the uitable data can just be a MATLAB table. I'd strongly encourage you to move to app designer. And in R2020a, the migration tool (has existed but is greatly improved) has made it even easier.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!