How can i transfer data from Matlab to Excel?

I have no idea on how to write a code for transfering data from matlab to excel on appdesigner. i search a code but i just see code on how to transfer data from excel to matlab on appdesigner.

Answers (1)

If you have data in a UITable and want to save it to a spreadsheet, you could create a callback function for a pushbutton to save the data to an Excel file.
You can access data with app.UITable.Data and save with the writetable function.

4 Comments

Hello, I already create a callback function for a pushbutton and i also try to write a code but it says me .Unrecognized method, property, or field 'value' for class'matlab.ui.control.EditField'.
here is my code: function ApprovisionnerButtonPushed(app, event)
sDispo = app.StockDisponibleEditField.value;
nStock = app.NouveauStockEditField.Value;
data = {sDispo,nStock};
gestock = 'data.xlsx';
sheet = 1;
xlswrite(gestock,data,sheet);
end
end
You need to capitalize value, it is case-sensitive.
sDispo = app.StockDisponibleEditField.Value;
I'm not understanding what you want to say
@MOUSSA FALL You need to change the first line of the function from this
sDispo = app.StockDisponibleEditField.value;
to this
sDispo = app.StockDisponibleEditField.Value;
Note: 'fields' are case sensitive.

Sign in to comment.

Categories

Asked:

on 15 Jan 2023

Commented:

on 16 Jan 2023

Community Treasure Hunt

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

Start Hunting!