Discussion:
error when saving: unable to write to MAT-file, File may be corrupt
(too old to reply)
Evi Daems
2009-03-05 18:05:04 UTC
Permalink
Hi,

Sometimes, when I try to save a matrix into a mat-file (save FileName Matrix ), I get the error: Unable to write to MAT-file FileName, File may be corrupt. When I try it a few times, sometimes it works, sometimes it fails. First I thought it has something to do with the fact that the mat-file already existed, but also for new mat-files, it sometimes fails.
Has anybody have an idea how to solve this?

Thanks!
Evi
JoeyB
2009-04-08 13:09:09 UTC
Permalink
Post by Evi Daems
Hi,
Sometimes, when I try to save a matrix into a mat-file (save FileName Matrix ), I get the error: Unable to write to MAT-file FileName, File may be corrupt. When I try it a few times, sometimes it works, sometimes it fails. First I thought it has something to do with the fact that the mat-file already existed, but also for new mat-files, it sometimes fails.
Has anybody have an idea how to solve this?
Thanks!
Evi
I'm having the same problem. This first attempt at save fails. The
next works:
??? Error using ==> save

Unable to write file
C:\Work\AmbientCorrection\PLT_658_1ALN6412_WOT.mat:
permission denied.
Pouria
2010-03-02 22:34:04 UTC
Permalink
i am also experiencing the same problem, on a random basis (i think, unless there is a solid reason) i get the unable to write to MAT-file error msg. sometimes it is a new file and sometimes when trying to rewrite the same file.

any information or discovery is much appreciated
i use Matlab 2008a(7.6.0.324)

Thanks

-P
Hi,
Sometimes, when I try to save a matrix into a mat-file (save FileName Mat=
rix ), I get the error: Unable to write to MAT-file FileName, File may be c=
orrupt. When I try it a few times, sometimes it works, sometimes it fails. =
First I thought it has something to do with the fact that the mat-file alre=
ady existed, but also for new mat-files, it sometimes fails.
Has anybody have an idea how to solve this?
Thanks!
Evi
I'm having the same problem. This first attempt at save fails. The
??? Error using =3D=3D> save
Unable to write file
permission denied.
Andrew Fiedler
2010-05-13 13:52:04 UTC
Permalink
I'm having the same problem with MATLAB R2009b (7.9.0.529). I seems completely random when it can save mat files and when it won't. Saving files to CSV in the same folder location works, and is a work-around for now but I have many programs that are already written to save MAT files which seem to fail for some inexplicable reason. Also, deleting the existing MAT files before trying to save new copies does not help.
Post by Pouria
i am also experiencing the same problem, on a random basis (i think, unless there is a solid reason) i get the unable to write to MAT-file error msg. sometimes it is a new file and sometimes when trying to rewrite the same file.
any information or discovery is much appreciated
i use Matlab 2008a(7.6.0.324)
Thanks
-P
Hi,
Sometimes, when I try to save a matrix into a mat-file (save FileName Mat=
rix ), I get the error: Unable to write to MAT-file FileName, File may be c=
orrupt. When I try it a few times, sometimes it works, sometimes it fails. =
First I thought it has something to do with the fact that the mat-file alre=
ady existed, but also for new mat-files, it sometimes fails.
Has anybody have an idea how to solve this?
Thanks!
Evi
I'm having the same problem. This first attempt at save fails. The
??? Error using =3D=3D> save
Unable to write file
permission denied.
Steven Lord
2010-05-13 14:30:49 UTC
Permalink
Post by Andrew Fiedler
I'm having the same problem with MATLAB R2009b (7.9.0.529). I seems
completely random when it can save mat files and when it won't. Saving
files to CSV in the same folder location works, and is a work-around for
now but I have many programs that are already written to save MAT files
which seem to fail for some inexplicable reason. Also, deleting the
existing MAT files before trying to save new copies does not help.
Please contact Technical Support and work with them to determine the
circumstances that cause this behavior so that if the problem is in MATLAB
that we can correct it and if the problem is in some aspect of your
configuration that you can take the appropriate action.
--
Steve Lord
***@mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ
Peter
2010-07-14 11:31:04 UTC
Permalink
Post by Andrew Fiedler
I'm having the same problem with MATLAB R2009b (7.9.0.529). I seems completely random when it can save mat files and when it won't. Saving files to CSV in the same folder location works, and is a work-around for now but I have many programs that are already written to save MAT files which seem to fail for some inexplicable reason. Also, deleting the existing MAT files before trying to save new copies does not help.
<skip>

Andrew, I experience the same problem. It seems random, and occurs with code which I haven't changed lately. Has Technical Support been able to help you out? Any feedback is appreciated.

Peter
Peter
2010-07-14 11:33:06 UTC
Permalink
Post by Andrew Fiedler
I'm having the same problem with MATLAB R2009b (7.9.0.529). I seems completely random when it can save mat files and when it won't. Saving files to CSV in the same folder location works, and is a work-around for now but I have many programs that are already written to save MAT files which seem to fail for some inexplicable reason. Also, deleting the existing MAT files before trying to save new copies does not help.
<skip>

Andrew, I experience the same problem. It seems random, and occurs with code which I haven't changed lately. Has Technical Support been able to help you out? Any feedback is appreciated.

Peter
Maurizio De Pitta'
2010-08-20 14:20:04 UTC
Permalink
Hi all,
indeed the same problem occurs also both on my laptop and PC (using MATLAB R2009a version 7.8.0.347) apparently essentially on random bases. The only note that I can make is that saving is still possbile through the GUI, but not from command line.

It usually happens after I have had matlab open for a while and very often when I resume from hibernation/Suspend my computer.

I need to quit and restart.
OSs are WinXP Pro SP2 and Vista 2008, Pro SP2.

If anyone does have any hint, is very welcome.
Thanks.
Maurizio De Pitta'.
Maurizio De Pitta'
2010-08-21 08:47:05 UTC
Permalink
Hi all,
indeed the same problem occurs also both on my laptop and PC (using MATLAB R2009a version 7.8.0.347) apparently essentially on random bases. The only note that I can make is that saving is still possbile through the GUI, but not from command line.

It usually happens after I have had matlab open for a while and very often when I resume from hibernation/Suspend my computer.

I need to quit and restart.
OSs are WinXP Pro SP2 and Vista 2008, Pro SP2.

If anyone does have any hint, is very welcome.
Thanks.
Maurizio De Pitta'.
Sven
2010-09-24 20:29:06 UTC
Permalink
Post by Maurizio De Pitta'
Hi all,
indeed the same problem occurs also both on my laptop and PC (using MATLAB R2009a version 7.8.0.347) apparently essentially on random bases. The only note that I can make is that saving is still possbile through the GUI, but not from command line.
It usually happens after I have had matlab open for a while and very often when I resume from hibernation/Suspend my computer.
I need to quit and restart.
OSs are WinXP Pro SP2 and Vista 2008, Pro SP2.
If anyone does have any hint, is very welcome.
Thanks.
Maurizio De Pitta'.
I experience the same problem when finishing a Stateflow code generation.
Is the problem already solved by the technical support? I couldn't even find a bug report for this issue.
On my computer is also Microsoft Access installed, which is registering the file extension .mat for its tables. Could the problem be an interference with Access?
Do the other reporters of this issue also use Microsoft Access on their computers?
Please let me know if it is worth to further investigate in this hypothesis!
Maurizio De Pitta'
2010-10-01 09:26:06 UTC
Permalink
Dear all,
has anyone found a solution meanwhile, to this problem?

It is now occurring on my MATLAB (version 7.8.0.347 R2009a) almost on daily basis. So far the cases when it occurs are:
- after MATLAB session has been open for a while (1 hour), even wihtout having saved anything before, any saving action is vanish.
- multiple MATLAB sessions are open and I am working with files in the same directory (this indeed might conflict with VISTA Admin rights handling)
- running routines / batch jobs that sequentially call the same routine and at each run this latter needs save data in a temporary file

It is somehow interesting that if I use the GUI to save, I am able to save either data or figures. The problem seems mainly from command line. Everytime it does occur, I need to shut MALTAB down and restart it.

Please help. This problem is now getting extremely irritating and seriously slowing down my work.

Best,
Maurizio.
Steven_Lord
2010-10-04 15:41:02 UTC
Permalink
Post by Maurizio De Pitta'
Dear all,
has anyone found a solution meanwhile, to this problem?
It is now occurring on my MATLAB (version 7.8.0.347 R2009a) almost on
- after MATLAB session has been open for a while (1 hour), even wihtout
having saved anything before, any saving action is vanish.
- multiple MATLAB sessions are open and I am working with files in the
same directory (this indeed might conflict with VISTA Admin rights
handling)
- running routines / batch jobs that sequentially call the same routine
and at each run this latter needs save data in a temporary file
It is somehow interesting that if I use the GUI to save, I am able to save
either data or figures. The problem seems mainly from command line.
Everytime it does occur, I need to shut MALTAB down and restart it.
Please help. This problem is now getting extremely irritating and
seriously slowing down my work.
You should contact Technical Support for assistance in determining the cause
of this problem.
--
Steve Lord
***@mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ
To contact Technical Support use the Contact Us link on
http://www.mathworks.com
Sven
2010-10-05 09:56:06 UTC
Permalink
For my code generation issue it helped to move the location of the mat file to a local drive instead of the former network share.
John
2012-04-23 15:28:06 UTC
Permalink
All,

I get an error like this except mine complains it can't write the *.mat to the current directory because there is "No such file or directory" (kind of a catch 22). I'm calling the "save" command in a MATLAB Function block of a Simulink model.

I found if I ran "clear all" at the command line before each run of the simulation that the problem went away. I'm not sure what magic is going on (clear all doesn't erase *.mat files), but understanding is sometimes overrated. I hope this helps someone.

Have a great day.
John
K E
2012-04-23 16:10:06 UTC
Permalink
I don't know if it is related, but I was getting an error on 'load' when it tried to load a mat file containing some Simulink output structures,
http://www.mathworks.com/matlabcentral/answers/35648-loading-structure-with-simulink-output-returns-timeseries-object-error
Try saving the mat file without any Simulink-specific variables and see if you still get the save error.
Maarten Jansen
2014-03-13 10:17:10 UTC
Permalink
I have the same problem and did not find a real solution.
As a last resort I constructed a try-catch solution with a retry:

% Ugly try-catch solution to ugly problem...
saved = 0;
while saved == 0;
try
disp(['Attempting to save file:' filename]);
save(filename);
saved = 1;
catch
warning('Problem saving, retry saving...')
pause(.5);
end;
end;
p***@gmail.com
2014-06-26 11:50:29 UTC
Permalink
Post by Evi Daems
Hi,
Sometimes, when I try to save a matrix into a mat-file (save FileName Matrix ), I get the error: Unable to write to MAT-file FileName, File may be corrupt. When I try it a few times, sometimes it works, sometimes it fails. First I thought it has something to do with the fact that the mat-file already existed, but also for new mat-files, it sometimes fails.
Has anybody have an idea how to solve this?
Thanks!
Evi
I had the very same problem. Save would fail with an error saying, 'Write failure'. When I examined the array I was trying to save, it would be incompletely written, suspended in between. You can see how much has been written if you choose to save as an ascii file, you can't if you choose to save as a 'mat'.

The issue was with the disk being full. There was no space to write the array. :D Quite funny but really did tick me off when it happened. Was in the middle of something really important and I started thinking 'what will I do now!????' Gosh!! :D
Antonio Mathworks
2015-10-28 15:23:03 UTC
Permalink
Post by Evi Daems
Hi,
Sometimes, when I try to save a matrix into a mat-file (save FileName Matrix ), I get the error: Unable to write to MAT-file FileName, File may be corrupt. When I try it a few times, sometimes it works, sometimes it fails. First I thought it has something to do with the fact that the mat-file already existed, but also for new mat-files, it sometimes fails.
Has anybody have an idea how to solve this?
Thanks!
Evi
Team, this is actually quite simple:
1) Add your folder under your SET PATH
2) Type the path+fileName when using load or save commands

E.g.
1) I added the folder C:\ImTheBest under SET PATH
2) save('C:\ImTheBest\MyMatFile.mat', 'var1')
3) load('C:\ImTheBest\MyMatFile.mat', 'var1')

Please accept my answer formally.
patel shital
2016-06-27 08:02:04 UTC
Permalink
Post by Evi Daems
Hi,
Sometimes, when I try to save a matrix into a mat-file (save FileName Matrix ), I get the error: Unable to write to MAT-file FileName, File may be corrupt. When I try it a few times, sometimes it works, sometimes it fails. First I thought it has something to do with the fact that the mat-file already existed, but also for new mat-files, it sometimes fails.
Has anybody have an idea how to solve this?
Thanks!
Evi
Elena Syerko
2016-12-15 17:52:04 UTC
Permalink
A possible reason to that can be that the data are too large to be written by a standard way into a .mat file. For the variables that exceed 2Gb in size you should use:

save('filename.mat','var_name', '-v7.3')

For more détails, see:

https://fr.mathworks.com/help/matlab/import_export/mat-file-versions.html

Sincerely
Post by Evi Daems
Hi,
Sometimes, when I try to save a matrix into a mat-file (save FileName Matrix ), I get the error: Unable to write to MAT-file FileName, File may be corrupt. When I try it a few times, sometimes it works, sometimes it fails. First I thought it has something to do with the fact that the mat-file already existed, but also for new mat-files, it sometimes fails.
Has anybody have an idea how to solve this?
Thanks!
Evi
Danylyna Shpakivska
2022-08-20 12:02:31 UTC
Permalink
Try reducing the length of the filename, it worked for me. In my case the data were not too large (0.12 GB) so it was not the problem.
Cameron Dennis
2023-09-11 22:31:47 UTC
Permalink
Signal/ : +1 818 650 0309
Text/ : +1 818 650 0309
Telegram :+1 818 650 0309 or @fasthookup102
wanji.nicolas @ yandex.con

Dumps with Pin is a really great way to invest your money to make Great profits. , but to
start making great profits you must know how to use Dumps+Pin!
When you buy aDump with pin, each piece comes with the track2 and the Pin to that
specific Dump. So, when making card you only need to write the track 2
For example: 4147097698495167=180320115218492901, this is the track2 and this is all
you need in order to write dump on to card.
Majority of stores and ATM’s where dumps are used DO NOT NEED TRACK1... Dumps with
Pin can be used all over the World where Visa, Master, AMEX, Discover and maestro are
excepted. You can use dumps with pin at almost every ATM and Store. So, the best way to
make full use of dumps is to check the balance at ATM and you can know the balance of
each Account before going to make purchases.
Some customers struggle in being able to use 201 Chip dumps, but there are many ways to
By-Pass chip.
These methods for 201 use are, the best method is using cards with the chip malfunctioned.
This means that the card has a chip which is programmed to malfunction chip readers and
automatically lets you swipe your card to make purchase. This works very good on VeriFone
and Ingenico, which are the 2-main card and chips readers in majority of stores around the
Globe.
Another method to use 201 dumps in stores is to Insert a card with a fake chip (not
programmed chip) Insert 3 times and then this will malfunction chip reader for you to be
able to swipe your card. These 2 methods are the best way to bypass chip readers for you to
be able to swipe 201 dumps and again track1 is not needed to use any of the Dumps with
Pin.
If you know how to use the dumps with pin, you will be able to maximize Profits for a
longtime. In our shop, we also offer credit Dumps with Pin and there is 2 ways to use the
Credit dumps. You can withdrawal cash from the atm with credit card Dumps+Pin. When
withdrawing from Credit card you must select the credit card option on the ATM not
Checking or Savings like the Debit dumps+Pin. when you do this, you will be able to
withdrawal cash from the Credit Line of the Account. You can Keep withdrawing cash from ATM until the credit card has Reached its credit .
best cc sites for carding, carding cc buy, cc sites for carding, sites to buy cc for carding, cvv shop cheap, best dumps with pin shop, carding cvv shop, cheap cc shop, best cvv dumps shop

cc cloning, fresh dumps ccv, buy cc clone dumps, card cloned dumps, buy dumps cloned emv, dumps cloned ccv



Signal/ : +1 818 650 0309
Text/ : +1 818 650 0309
Telegram :+1 818 650 0309 or @fasthookup102
wanji.nicolas @ yandex.con

ATM WITHDRAW - CLONED CARDS & ONLINE PREPAID CVV CARDS WITH BALANCE (WORLDWIDE SHIPPING)


We obtain hacked credit cards data and then write this data to a plastic card, We provide complete info and pin code to a buyer and you can easily cashout the real money from any ATM around the world. You will get complete cloned card details along with the card. We provide 24 hours delivery within USA, Uk, Canada, Germany and Dubai etc. For All other countries shipping time will be different.

We also sell CVV prepaid cards that can be used online on any website.

Plastic Cloned Cards Price List :-

Low balance
$150 for balance $1.5k
$250 for balance $3k
$350 for balance $4K
$450 for balance $5k
$550 for balance $7k

High Balance

$1k for balance $15k
$2k for balance $30k
$3.5k for balance $50k
$5k for balance $ 70k

Delivery & Details :-

We obtain hacked credit cards data and then write this data to a plastic card, We provide complete info and pin code to a buyer and you can easily cashout the real money from any ATM around the world. You will get complete cloned card details along with the card. We provide 24 hours delivery within USA,Uk,Canada,Germany and Dubai etc. For All other countries shipping time will be different.

Prepaid Cards (Visa - Mastercard - American Express) :-

These cards are not associated with a bank account or person and are therefore considered the safest cards to use. These cards costs are a little more expensive than cloned cards because we've already clearing a clone card and transferring money to a prepaid card. With this card you can enjoy all the possibilities of use (shopping in stores and withdrawals) along with peace of mind.

Prepaid Card With 2500$ = 300$ Bitcoins

Prepaid Card With 3000$ = 400$ Bitcoins

Prepaid Card With 4000$ = 500$ Bitcoins

Prepaid Card With 7000$ = 650$ Bitcoins

Prepaid Card With 9000$ = 750$ Bitcoins

Is it Safe?

Yes, it’s absolutely safe if you do a little effort and don't let others around the ATM see how the card looks like.

All cards are safe for delivery and are not prohibited items. We make sure to send the cards in safe packages such as: greeting cards, magazines and more. In addition, our cards look exactly like a regular credit card with a high quality of printing and embossing. Even if the parcel is opened there is nothing to incriminate you.

When will you send my order after payment?

We will ship your order within 24 hours after payment.

Do you give the tracking number?

If you choose Express or Overnight delivery, we will send you the tracking number immediately after sending.

What is difference between a cloned card and prepaid card?

Cloned card is a card whose details have been copied using a dedicated device called “ATM Skimmer” or by hacking into credit card databases on the Internet. The card is associated with a person’s bank account.

Prepaid card is a card that can be used anywhere that accept a Visa, MasterCard or AMEX but the difference is that it is a card that is not associated with any bank account and does not have any identification information and therefore its use is completely anonymous.

Do you provide PIN numbers?

Yes. all cards have magnetic stripe & chip with 4 Digit PIN Code.

To what countries do you ship?

EU, US, ASIA, AFRICA - DEPENDING ON COUNTRY MOSTLY VIA DHL, USPS, ROYAL MAIL OR YOUR COUNTRIES NATIONAL POSTAL SERVICE with Tracking (Not always accurate or delayed updates)

EU COUNTRIES - ASK FIRST

USA 1-3 DAYS with MOSTLY WITH UPS OR DHL with Tracking

RUSSIA 6-9 DAYS with Tracking then passed to Russian National Postal Service for delivery to your address. (Tracking not always accurate as there is delay in update until received in Russia)

What countries can I use these cards?

Visa and MasterCard are international cards, and you can withdraw them at any ATM.

Can I use these Online buy things?

No they do not work online. Just to withdraw at ATM but I have another service where I sell prepaid cards for online buying just ask me.

Why don't you withdraw yourselves?

Of course, we withdraw for ourselves. But we cannot cash much money in one small city, because it is dangerous. It is also very dangerous to cooperate with agents in other cities, because they can be the police. It is easier and safer for us to deal with the sale. It's easy to withdraw small scale cash but when we keep doing it it becomes riskier as we have to prove where the money came from and it's very hard to launder cash into businesses. We need bitcoin directly so we can launder it into other businesses without banks, local jurisdictions asking us questions. We also believe in Bitcoin and hope to get rich with it. (Jokes) It works better if we sell to other people because they need few of them to pay off things.

Message us via private telegram, WA, email etc.



Signal/ : +1 818 650 0309
Text/ : +1 818 650 0309
Telegram :+1 818 650 0309 or @fasthookup102


===> Price for Dumps Track 1&2 With Pin ATM

** Usa :101

- Visa Classic, MasterCard Standart =45$

- Visa Gold|Platinum|Business, MasterCard Gold|Platinum = 50$

- American Express = $50 (Without SID)

- Discover = $50

** Canada: 101 201

- Visa Classic, MasterCard Standart = 45$

- Visa Gold|Platinum|Business, MasterCard Gold|Platinum = 50$

** EU, UK: 101 201

- Classic|Standart = 60$

- Gold|Platinum = 70$

- Business|Signature|Purchase|Corporate|World = 100$

** ASIA/AUSTRALIA/Exotic: 101 201 121

- MasterCard| Visa Classic = $50

- Visa Gold|Platinum|Corporate|Signature|Business = $70

** Other countries: 101 201

- MasterCard| Visa Classic = 50$

- Visa Gold|Platinum|Corporate|Signature|Business = 70$

USA Dumps Track1 + Track2 (no Pin)
101, 121 = $50 per 1
201, 221 = $40 per 1
USA Dumps Track1 + Track2 with Pin
101, 121 = $150 per 1
201, 221 = $100 per 1
UK Dumps Track1 + Track2 (no Pin)
101, 121 = $80 per 1
201, 221 = $64 per 1
UK Dumps Track1 + Track2 with Pin
101, 121 = $200 per 1
201, 221 = $160 per 1
Canada/Australia Dumps Track 1 + Track2 (no Pin)
101, 121 = $60 per 1
201, 221 = $48 per 1
Canada/Australia Dumps Track 1 + Track2 with Pin
101, 121 = $160 per 1
201,221 = $120 per 1
[13:43, 07/06/2023] OG: EU/Asia/South America/Africa Dumps Track1 + Track2 (no Pin)
101, 121 = $100 per 1
201, 221 = $80 per 1
EU/Asia/South America/Africa Dumps Track1 + Track2 with Pin
101, 121 = $240 per 1
201, 221 = $200 per 1



Signal/ : +1 818 650 0309
Text/ : +1 818 650 0309
Telegram :+1 818 650 0309 or @fasthookup102

price for Software EMV

SOFTWARE GOOD OMNIKEY, MCR 200, ACR 38, ACR 92, ACR 122, EMV 160, EMV 200

TEACH HOW USE SOFTWARE:EMV Reader Writer Software Is able To read write or duplicate Credit Or Debit Card's.

We are Glad to introduce to our costumers the new EMV Reader/Writer v8.6 which is more powerful then (EMV Reader Writer Software v8)

EMV Reader Writer Software v8.6 is the most powerful EMV Smart Card Reader/Writer Software in the world.

Development by EmvGlobalSolution Software Team,

EMV Reader Writer Software v8.6 Is able To Read/Write/Duplicate/Delete any EMV Protocol such as 201,206,226 or any EMV other Protocol,it will allow you to Read/Write/Duplicate/Erase SDA(Static Bin) / DDA (Dynamic Bin)

PRICE for Software is $300


Signal/ : +1 818 650 0309
Text/ : +1 818 650 0309
Telegram :+1 818 650 0309 or @fasthookup102

Loading...