Getting index of multidimensional array passed to mex function

1 view (last 30 days)
Kamran on 19 Jun 2020
Commented: Kamran on 22 Jun 2020
I have an 4D array of size 31*229*374*80 (id, y, x, z) which I pass as input to a mex function. This is read as a 1D array in the mex function and is repoted as being a 229* 11594*80 (11594 = 31*374). I am confused about how to get the value of a given index in the function now. Suppose I want to get the value of array number 10 and inexes 50, 100, 40 in the 1D array in the mex function. How do I get to the correct address in the array ?
Thanks in advance,
Kamran on 22 Jun 2020
Sorry, my stupid mistake. I was already reshaping the matrix before sending it to mex function.

Sign in to comment.

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!