c++ and matlab functions equivalent

조회 수: 6 (최근 30일)
khairul ismail
khairul ismail 2013년 6월 11일
correct me if i'm wrong.. as i just started learning how to use c++ and matlab, there is a matter i confused. i know that to call c++ code from matlab i have to replace my main() to mexFunction(). i've done that..here i want to know is that functions like mexprintf and soon must be used instead of cout(c++) in other source files? and is it the functions like mexprintf, mexCALLMATLAB etc only used inside mexFunction?

채택된 답변

Friedrich
Friedrich 2013년 6월 11일
Hi,
yes and yes. See at the bottom here for the cout question
and for the mexPrintf and mexCallMATLAB: Those functions are definied in the mex.h and work only inside a MEX file.
  댓글 수: 1
James Tursa
James Tursa 2013년 6월 11일
편집: James Tursa 2013년 6월 11일
@Khairul: To clarify, all of the mex API functions can be used anywhere in your mex code. You don't have to call them from inside the mexFunction itself.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Write C Functions Callable from MATLAB (MEX Files)에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by