How to "quicksave" a file in app designer?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Huguette Djoumsap Takam
el 30 de Jul. de 2021
Comentada: Huguette Djoumsap Takam
el 15 de Ag. de 2021
Hi Community,
i devellop a little app for kinematic simulation and can save the simulation result. But i have an issue with my "quicksave" button.
The role of the "quicksave" button is to first save the simulation result as an normal save function. Then if i change something in the simuation then i need to save the changes without giving one more time a new pfad. It means, that "Quicksave"-function needs to remenber the save-path and if it exists save in that path.
Now i wrote this code, but everytime i clicked on the "quicksave"-button i still need to choose the path. Can anyon have an idea, where something i'm doing wrong?
Thanks in advance for the help
% Button pushed function: SaveButton
function SaveButtonPushed(app, event)
if app.isNotValid
return
end
dStr = string(datestr(now(),'yyyy-mm-dd_HH-MM'));
sysVar = app.System;
sysName = app.System.Name;
[file,path] = uiputfile(".mat","Save AnimTronics System",sysName + "_" + dStr);
% if isnumeric(file) && file == 0
% return
%end
fileName = fullfile(path,file);
% File exists
if exist(fileName,'file')
save(fileName,"sysVar");
else
%if file does not exist
Call_SaveAsButtonPushed(app)
end
end
end
0 comentarios
Ver también
Categorías
Más información sobre Environment and Settings en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!