Returning status of operation using mex
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
After i call to the mex function i written to do fopen, fred and fclose, how do i return the status to my mat file to check whether the file has been read or opened?
0 Kommentare
Antworten (1)
Chirag Gupta
am 16 Dez. 2011
mex functions can return outputs:
void mexFunction(int nlhs, mxArray *plhs[], int nrhs,
const mxArray *prhs[]);
The nlhs : number of left hand arguments and plhs are the arguments you wish to return.
So you could return the status of the MAT file in plhs. You would call this function in MATLAB:
status = NameOfYourMexFunction(inputs);
0 Kommentare
Siehe auch
Kategorien
Mehr zu Write C Functions Callable from MATLAB (MEX Files) finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!