How do I save using the App Designer
Ältere Kommentare anzeigen
Hi, i've been struggling trying to get app designer to load in and then save a .mat file.
Loading in is fine.
function LoadButtonPushed(app, event)
app.File = load("data.mat");
app.UITable.Data = app.File.data;
end
data.mat is 50x9 table which itself holds additional tables within one column. I can show this data in a table easily enough as I have above.
I shall edit this data at a later point..
My question/problem is that:
All I want to do at the moment is to take this and save it as a seperate .mat file when I press a save button on my App in App Designer. However nothing I seem to do works.
function SaveButtonPushed(app, event)
app.File.Newdata = app.File.data; % Sticks the data into Newdata
%save('NewData.mat','-struct','app.File.NewData')
%save('NewData.mat') % Doesn't work
%save('NewData.mat','app.File.NewData')
%Below I tried to save the structure to a variable and then save it that way
NewData = app.File;
save(NewDataFile,'-struct','NewData');
end
Please if anyone has a solution I would be appreciative as I cannot seem to get it to work.
All I want is another file to be made with the data in.
7 Kommentare
Robert Jack
am 1 Jun. 2020
Bearbeitet: Robert Jack
am 1 Jun. 2020
Geoff Hayes
am 1 Jun. 2020
Robert - I'm not sure I understand but you say that The issue is when I open the NewDataFile.mat I get both the old and the new Data.. Whereas I only want the old data. If you only want the old data, then can't you just load the 'data.mat" that only has the old data in it?
Robert Jack
am 1 Jun. 2020
Bearbeitet: Robert Jack
am 1 Jun. 2020
Geoff Hayes
am 1 Jun. 2020
hmmm...how do you determine what is old data and what is new? Do you allow the user to edit or delete the old data or just add new data to the table? If the latter, then you should be able to determine where the new data starts in the table (assuming that the user or the code doesn't switch the order of new and old rows).
Robert Jack
am 1 Jun. 2020
Robert Jack
am 1 Jun. 2020
Debt
am 24 Jul. 2021
I have a similar a problem,can you upload your files and data.mat ?I want to learn from them,thank you very much
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Develop Apps Using App Designer finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
