Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

unable to read mat-file, not a binary mat-file

2,241 views
Skip to first unread message

Jayson Brouchoud

unread,
May 29, 2009, 12:52:02 AM5/29/09
to
I'm getting the following error when running a compiled version of a GUI, running the GUI from MATLAB works just fine.

??? 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?

Jayson Brouchoud

unread,
May 29, 2009, 1:03:01 AM5/29/09
to
"Jayson Brouchoud" <brou...@tc.umn.edu> wrote in message <gvnpli$lup$1...@fred.mathworks.com>...

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?

Jayson Brouchoud

unread,
May 30, 2009, 2:30:04 PM5/30/09
to
"Jayson Brouchoud" <brou...@tc.umn.edu> wrote in message <gvnqa5$4m9$1...@fred.mathworks.com>...

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?

YUNDE

unread,
Apr 4, 2012, 3:29:12 PM4/4/12
to
"Jayson Brouchoud" wrote in message <gvnpli$lup$1...@fred.mathworks.com>...
I am having the same problem. The GUI .fig cannot be opened and I did not change anything. It was working last Tues and when I was trying to open it this Mon it kept saying:

??? Error using ==> open at 159
Unable to read MAT-file
/Users/TA/Desktop/TremorAnalysis_BigScreen/TremorAnalysis_V1.fig: not a binary
MAT-file.
Try LOAD -ASCII to read as text.

I have been working on this for one year :(

Help please!

diya

unread,
Dec 30, 2015, 2:01:14 AM12/30/15
to
"Jayson Brouchoud" wrote in message <gvnqa5$4m9$1...@fred.mathworks.com>...

Ambarish Desai

unread,
Apr 27, 2017, 3:31:07 PM4/27/17
to
"diya" wrote in message <n5vvff$af6$1...@newscl01ah.mathworks.com>...
Not sure if you are still looking for a solution to this, it has been 2 years..
But i had a similar problem using another software. I found the problem was using a struct. so i converted each struct to arrays, like time = struct.time and data = struct.data. Then saved only time and data into a separate mat file. Import of this mat file worked perfectly. good luck!
0 new messages