On 15 Feb, 13:40, "The Cool Giraffe" <giraf...@viltersten.comwrote:
I have a 3D matrix in MatLab and i have saved it binary
(i think) to a file data.mat and now i'd like to retrieve
those values in C++.
Even though i'm a ground breaking genius working with
extremely innovative frontier of science (joke intended)
i can imagine _SOMEBODY_ needed to perform such an
operation before me as well. Hence, i have a feeling
that there's an easy way to do that.
Am i mistaken? If so, please advise on what to think
about when reading such a file. In other case, what
method to use?
You need to ask a MATLAB support forum. This isn't a C++ language
question. You might want to start from
http://www.mathworks.com/matlabcentral/
I believe .mat files are binary (I just looked in one and it didn't
look like text to me). That means that to read one, you need to know
the format of the data. The first question to ask is whether the
format is publically available. If so, it is quite likely that someone
has already written a C++ library for what you need. A MATLAB forum or
Google are where I would start looking.
If you do end up writing something in C++ yourself, one general piece
of advice is to make sure you open your file reading stream in binary
mode. If you end up with specific C++ problems, ask away here.
Gavin Deane