0

I have a 2-D double-precision array in MATLAB that contains specific data. I want to use this array in c++, so I save the array in a mat-file. I know that MATLAB has some c functions that provide reading mat-file in c++ (matdsgn , matOpen , ...), but I don't know how to use them in a c++ program. Actually, I don't know how to use a C library in C++. Any help would be appreciated.

2
  • 2
    Possible duplicate of Efficient way of converting matlab matrix to array in c++ Commented Aug 28, 2017 at 11:13
  • I'd recommend thinking about whether what you really want to do is create a MAT file on disk and then work with this MAT file in your standalone C++ program, or whether what you would prefer to do is simply pass the MATLAB array to C++ code. If it's the latter, you should look at the MEX interface provided by MATLAB for this purpose: mathworks.com/help/matlab/matlab_external/… Commented Aug 28, 2017 at 15:00

1 Answer 1

0

If you have MATLAB 2017a, there is a built-in function. See this MATHWORKS link: Math Works

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.