How to load a mat file in mex with input string as file path?
조회 수: 2 (최근 30일)
이전 댓글 표시
I'm writing a C code for Mex where in I have to load about 1000 mat files. The names of mat files are stored in cell array in another mat file. The input to the main function has the path from where I have to load this cell array mat file and then later iteratively I have to load each of the 1000 mat files which are saved in the same path. How do I load the mat file when I have the path as a char variable in Mex. So far this is my code: -
char *srcpath;
srcpath = mxCalloc( ((mxGetM(prhs[2]) * mxGetN(prhs[2])) + 1), sizeof(char));
mxGetString(prhs[0], Type, ((mxGetM(prhs[0]) * mxGetN(prhs[0])) + 1));
How do I proceed further? Like how can I do
load([srcpath,'datainfo.mat']);
댓글 수: 2
답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!