From: Claudio Pedrazzi on
Hi everybody,
it's the first time that I am confronted with the following problem. I have a simple application where the user is prompted to choose a file (with uigetfile). In my specific case, this involves also changing the directory.
I would like that, the next time the same user will use the application, the default directory where he will be put will be the one chosen in this run.
Generalizing the concept, I would like to have the capability of remembering user answers and using them as defaults for the next execution of the application. Saving in a mat file is of course an option, but I don't really know "where" to save, because the application can be started from any directory.

Is there any better way? I searched the newsgroup but I probably used the wrong keywords... I did not found what I'm looking for.

Thanks a lot for any suggestions
Best Regards
Claudio
From: Walter Roberson on
Claudio Pedrazzi wrote:

> it's the first time that I am confronted with the following problem. I
> have a simple application where the user is prompted to choose a file
> (with uigetfile). In my specific case, this involves also changing the
> directory.
> I would like that, the next time the same user will use the application,
> the default directory where he will be put will be the one chosen in
> this run.
> Generalizing the concept, I would like to have the capability of
> remembering user answers and using them as defaults for the next
> execution of the application.

Consider using setpref() and getpref()
http://blogs.mathworks.com/desktop/2010/05/31/command-line-preferences/
and see also uigetpref()
From: Claudio Pedrazzi on
Thanks a lot Walter! I wasn't aware of the existence of those two commands! That is what I was looking for.
Regards
Claudio