Hello, i want to send from my matlab-function a path of a file to my mex-function. Then in my mex-function i want to open the file. Sorry for that quite simple question but i m quite a beginner in mex and c.
Heres my try to solve the problem. If someone could give me an advise how i could solve this i would be very grateful. Many thanks!
//In my matlab-script i call the mex-function like this:data= myMex("c:\\testdata.dat");//Then in my mex-file i try to use the argument filepathmxChar *filename;mxArray *xData; FILE * pFile;xData = prhs[0];filename = mxGetChars(xData);pFile= fopen(filename, "rb"); // result: file could not be opened
Best Answer