I have a problem with my c++ code. I want to return a matrix of k-dimensions from my cpp program to Matlab.
The matrix I want to pass is stored in all_data
all_data
It looks like mxGetPr is returning you a pointer to an array of doubles and you are assigning it to a vector of vectors.
This should work:
double* indexes = mxGetPr(plhs[0]);