MATLAB: Mexfunction

mex

please guide to me i have C++ program that is long and complete algorithm however i call this program from matlab because i have some difficulty to rewrite this C code to m file. so pls tell me how to cal this C code from matlab.And then how to write mex function. pls explain me!

Best Answer

you create a mexFunction in which you tell matlab how many outputs and inputs and you read your inputs and define your outputs. I think this link can help you
The truth is you need to play with it, in that page there are very simple but meaningful examples. It also points you to build in examples inside matlab.