How do I save using the App Designer
显示 更早的评论
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 个评论
Robert Jack
2020-6-1
编辑:Robert Jack
2020-6-1
Geoff Hayes
2020-6-1
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
2020-6-1
编辑:Robert Jack
2020-6-1
Geoff Hayes
2020-6-1
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
2020-6-1
Robert Jack
2020-6-1
Debt
2021-7-24
I have a similar a problem,can you upload your files and data.mat ?I want to learn from them,thank you very much
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Develop Apps Using App Designer 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
