0
W trakcie analizy

Saving leads to corrupt file

JFW 6 miesięcy temu Ostatnio zmodyfikowane przez Pavel Holoborodko 6 miesięcy temu 3

I have a loop in which I generate approximately 100 mp matrices with sizes ranging form N = 4 to ~1500. In order to use them later I save them as cell entries (A{i} = A). In some instances these will save, other times I get a corrupt file error warning.

It always happens with the same matrices, just wth some parameters I get the errors with others I don't.

Any ideas or suggestions?

W trakcie analizy

Hello, 


Do you save to "mat" file? It is MATLAB's responsibility to save data/matrices to "mat" files (unless you use mp.wrire/mp.read) .

Please provide minimal, complete, and verifiable example, so that situation can be reproduced.

Yes, I am generating .mat files.


I cannot seem to find the simplest conditions to generate the errors and it is only after a lot of code. I was hoping you would say "Oh, MATLAB doesn't like saving XXXX so instead do YYYY".

I'll get back if I can easily replicate the problem with a short example.

Thanks, JF.

If your matrices are 2D then you can use special functions from toolbox: mp.write/mp.read 

They save matrices in text form, this can be transferred across different platforms (run "doc mp.write" for more information).

Another important thing is to make sure toolbox is loaded by MATLAB before you try to read the "MAT" file with mp-matrices.

Setup precision mp.Digits() or run other command to load the toolbox in MATLAB. Then read "MAT" file. This way MATLAB will understand the type "mp".