??? Error while evaluating TimerFcn for timer 'Scheduler_timer'
Error using ==> load
Unable to read MAT-file D:\Scheduler\Scheduler.mat: not a binary MAT-file.
Try LOAD -ASCII to read as text.
For a little more background. I am developing 2 GUIs that are being compiled using deploytool on a Vista home premium machine running matlab 2007a and testing on a xp pro machine without matlab installed. There are two GUIs that each have multiple timers with TimerFcns that load and save to a single shared .mat file. When I run both GUIs at the same time inside matlab, I have no problems, but when I compile the two GUIs independently and run them, then I get this error. Is there some kind of file I/O error with reading / writing simultaneously that is otherwise handled inside matlab? I haven't found any kind of isopen function to check to see if a .mat file is already being saved or loaded to avoid a conflict.
Any advice?
Update already: I am able to reproduce the problem in matlab if I run each of the GUIs in separate instances of matlab. Still don't know what causes it or how to fix it.
Any advice?
UPDATE:
So I retrieved the .mat file that it was having errors with and it actually is corrupt. I don't know how the file got corrupted. I put the following code on all my load and saves (although I don't think it will do anything for the save) so that if it fails loading, it will try again before working with bad data. The idea was that it couldn't read since the .mat file was being read/written elsewhere at the same time.
test=1;
TryCounter=1;
while (test && (TryCounter<11))
try load('Scheduler.mat');
test=0;
catch
TryCounter=TryCounter+1;
fprintf(1, '%s\n', 'Error: m-function name, error number');
end
end
but this doesn't seem to be helping me any. What seemed to make the most difference is to eliminate as many as -appends as I could, but this doesn't seem to have solved my problem.
Somehow having the GUIs run in the own workspace or as independent .exes is corrupting my .mat file.
Any Advice?