Info

This question is closed. Reopen it to edit or answer.

Files disappear after using Arduino support package

1 view (last 30 days)
Anne M
Anne M on 1 Aug 2014
Closed: MATLAB Answer Bot on 20 Aug 2021
I am using the Arduino Uno Support Package in R2014a. I have successfully tried out a few Simulink programs with no more serious problems than the icons in the Simulink library occasionally disappearing. However, when I go back to look at my work on a different date, I find the directory in which I had saved my files completely empty.
Mindful of this problem, last time I made regular manual backups by copying my folder in Windows Explorer. Today I looked at the copied folders, and they contain all the my files and the additional directories created when Simulink builds the file. But the original working directory is completely empty - no files, no directories, nothing.
This problem is so strange that I don't even know where to begin to diagnose the issue. I suppose I should experiment to find out exactly when the files disappear (right when I shut down MATLAB?), whether additional (say text) files in the folder are deleted too, and whether working in multiple directories causes them all to be deleted or just one.
Has anyone else seen this problem and figured out what is going on?

Answers (1)

Star Strider
Star Strider on 2 Aug 2014
‘the original working directory is completely empty - no files, no directories, nothing’
How did you look for them? Did you look in the MATLAB file path or using File Explorer? (I know you found your saved files in File Explorer, but did you also search in your MATLAB directories for them with it?
The reason I’m curious about this is that the fact that some MATLAB-associated function created them doesn’t mean that it permanently added them to the MATLAB file path. They may be where you (or the application) created them, simply not available to you.
Wild guess here, but if that is the situation, consider using the savepath function before you exit MATLAB.
  2 Comments
Anne M
Anne M on 4 Aug 2014
While I was working, I could see the files in the MATLAB working directory and in Windows Explorer. I used Windows Explorer to make my backup copies which still exist. The files/folders in the original working directory cannot be found in either MATLAB or Windows Explorer.
The first time this happened (before I knew to make backup copies):
-MATLAB, in its directory history, had some of the directories that had been created when I built my Simulink models for Arduino, since I had navigated to those directories while working. When I selected that as a working directory from MATLAB's history, MATLAB said the directory did not exist.
-I used the Windows to search function to search my entire hard drive for the file name of my Simulink model. It was nowhere to be found, and not in the Recycle Bin either.
I am willing to try savepath or anything else that might shed light on this obscure problem. Thanks for the suggestion.
Star Strider
Star Strider on 4 Aug 2014
My pleasure. Using savepath is the only possibility I can think of. It would at least allow you to access the directories you created. You can also use the movefile function to create automatic backups in a separate directory in the same finish.m file. You could then create a separate function to run optionally or as part of your startup.m file to check for their existence in the directories you created them in, and copy them back if they’re missing. Your backup directory would not have to be in the MATLAB search path, so long as your functions know where to look.
I can’t imagine why your Simulink files disappeared, though. I don’t use Simulink often enough to have ever encountered this problem. I suggest you report this behavior to TMW as a bug. At least they might have a fix or at least an explanation and a workaround for it.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!