필터 지우기
필터 지우기

reading mat files in C++

조회 수: 3 (최근 30일)
John Knowles
John Knowles 2016년 7월 26일
편집: John Knowles 2016년 7월 27일
I would like to compile a console application using the XCode 7.3 GUI. The application would read information from a mat file, and to test it I thought I would try the matlab example diagnose.cpp. It has previously been noted that compiling this outside of Matlab requires specifcation of the path to the libmat.dylib, which in my case is /Applications/MATLAB_R2015b.app/bin/maci64. However I could not find out how to specify this in the Xcode GUI. Any suggestions as to how to do this? I am trying to avoid using the matlab compiler as this results in very slow standalone programs.

채택된 답변

Wayne Xun
Wayne Xun 2016년 7월 26일
Hi John
I found a tutorial for XCode 7.2. This is a bit older than your version, but hopefully you'll still be able to follow it. TUTORIAL
Hope this helps
  댓글 수: 1
John Knowles
John Knowles 2016년 7월 27일
편집: John Knowles 2016년 7월 27일
Hi Wayne:
That really helped a lot for the mat functions. I never would have figured that out on my own. Now the strange thing is that I am getting errors for failing to link to what I think are mex API functions, even though, following the tutorial, I linked to the LibMex.dylib library also. I show these errors below. For instance mxDestroyArray is listed in the Mathworks page as a function in Matrix.h. I could not find it in there, but that file consists mainly of pre-processor commands, so it could be included from somewhere else.
Am i interpreting these errors correctly as due to a missing lib file? Is there an easy fix? many thanks,
John
Undefined symbols for architecture x86_64:
"_mxDestroyArray", referenced from:
diagnose(char const*) in Diagnose.o
"_mxFree", referenced from:
diagnose(char const*) in Diagnose.o
"_mxGetNumberOfDimensions_730", referenced from:
diagnose(char const*) in Diagnose.o
"_mxIsFromGlobalWS", referenced from:

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Build MATLAB Interface to C++ Library에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by