How to save a c++ readable Mat file

조회 수: 2 (최근 30일)
Andrew
Andrew 2013년 1월 30일
I am running a DCT code in matlab and i would like to read the compressed file(.mat) into a c code. However, am not sure this is right. i have not yet finished my code but i would like to request for an explanation of how to create a c++ readable file from my mat file. Am kinda confused when it comes to .mat, .txt and then binary, float details of files. Someone please explain to me this.

답변 (1개)

James Tursa
James Tursa 2013년 1월 30일
편집: James Tursa 2013년 1월 30일
Are you trying to read the compressed mat file into C++ without the aid of the MATLAB API library? If so, this is not at all trivial. It would be better to write the files out using fwrite, which would be straightforward to read into C++. If you are using the MATLAB API library then there are several functions available you can use listed here:
href = ""<http://www.mathworks.com/help/matlab/read-and-write-matlab-mat-files-in-c-c-and-fortran.html</a>>
  댓글 수: 3
James Tursa
James Tursa 2013년 1월 30일
Again I have to ask you, will you be running the C++ code on a machine that has MATLAB and thus you have access to the MATLAB API library of functions?
Andrew
Andrew 2013년 1월 31일
yes sir, i am running both programs(c++ and matlab) on the same machine.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by