Filter löschen
Filter löschen

How do I save data from a matlab GUI table onto a text file when the user clicks a pushback button on the same gui?

4 Ansichten (letzte 30 Tage)
writetable(T) only saves data to a textfile in the same location as the program. I want to be able to give the user an option to enter his own text file name and location. Please suggest what code I should enter in my callback as shown:
% --- Executes on button press in savebutton.
function savebutton_Callback(hObject, eventdata, handles)
% hObject handle to savebutton (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)

Antworten (1)

Geoff Hayes
Geoff Hayes am 5 Nov. 2017
Rahul - according to writetable, you can specify the full path along with the filename. So if you have a table T, then you would save it to some file as
fullpathAndFilename = '/users/geoff/mytable.txt';
writetable(T, fullpathAndFilename);
Try the above and see what happens!
  4 Kommentare
Rahul Pillai
Rahul Pillai am 5 Nov. 2017
The writetable function makes use of a write() function inside of it's code structure. When I made a call to writetable() the error generated pointed to this.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Migrate GUIDE Apps finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by