How do you create a push button that saves data from a GUI?

3 ビュー (過去 30 日間)
deenessen armoogum
deenessen armoogum 2019 年 6 月 1 日
How to do it?

採用された回答

Geoff Hayes
Geoff Hayes 2019 年 6 月 2 日
編集済み: Geoff Hayes 2019 年 6 月 2 日
deenessen - you haven't given us much to work on, but presumably your GUI has a button that, when pushed, you want to save some data to an Excel file. Assuming that GUIDE is being used, then your pushbutton callback would look like
function pushbutton1_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% get and format your data
myData = randi(42, 10,3);
% write your data to file
writematrix('myFile.xlsx', myData);
Depending upon your version of MATLAB, you could use writematrix or xlswrite.
  10 件のコメント
deenessen armoogum
deenessen armoogum 2019 年 6 月 5 日
I want to put all the coding in the pushbutton
deenessen armoogum
deenessen armoogum 2019 年 6 月 5 日

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

その他の回答 (1 件)

deenessen armoogum
deenessen armoogum 2019 年 6 月 3 日
Programmatically use gui I have already created the edit box and pushbutton so far

カテゴリ

Help Center および File ExchangeSpreadsheets についてさらに検索

製品


リリース

R2007a

Community Treasure Hunt

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

Start Hunting!

Translated by