Hello I would like to get some help with something please:
I'm trying to make readable a int8 vector (which was actually retrieved from an already binary .mat file via a MySQL database).
I'd like to do something like:
fileId = fopen(fileName, 'w');
fwrite(fileId, vector,'uint8');
fclose(fileId);
load(fileName);
But Matlab throws an error "File may be corrupt".
The idea behind this, is to use a central database to stock our .mat files.
vector is a [ 306624x1 int8] and looks like:
vector = [77;65;84 ...
Thanks for any help
Edit
I'm continuing with this task, the solution that @Rotem gave me works perfectly. I have millions of .mat files, which are really slow to read from a hard drive.
So, I have changed to a database and in order to retrieve these files I do mysql queries (this is much faster).
I recover each file as a vector of bytes, then I write in a local hard drive and reloaded using load().
@Rotem helped me with that, but now I'm facing the problem of space disc. There is a way to perform this conversion directly without passing through fwrite - load?
Thanks for the lights!
fwrite, you wantsaveif your goal is a MAT file.