Hi, I create a GUI file in Matlab. It work truly, but when I make it in exe format by 'deploytool". I face a problem. I have .mat file and it is the file which my program add data by "save" and "load", but when it is in exe format, .mat fileremain empty and any add recored is not done.
Call them. I've never experienced that before - where the compilation process, or the installation process, totally empties out a mat file. Sounds very weird so it could be that you are not adding the mat file you think you are, or your code deletes existing mat file and creates a new empty one.
No all things are right. When I run my program in matlab space, it work truely. However, it work bably in .exe format (save comment)
In an .exe, using
means to save the object into whatever directory the executable happens to be in, which by default would be the temporary directory the executable unpacked itself into. The default directory for executables will not be the directory that the user was somehow "in" when the user clicked on the icon to start the program.
See the documentation for ctfroot()
Thank you all.
I use below code as our friend said and my program works truly.
pathname = pwd;
baseFileName = 'MyDatabse.mat';
fullFileName = fullFile(pathname, baseFileName);