Hi
I am having a problem using mxSetFieldByNumber. I want to set fields in a N-D structure array. I have no problem with setting fields in a Nx1 structure array. With a Nx1 structure array index is set as a int and corresponds to the element I want to write data.
int index;field_num = mxGetFieldNumber(pa, "field_name");mxSetFieldByNumber(pa, index, field_num, new_value_pa);
But with a N-D structure array I cant seem to find a way to write data to the second column in the array. I if I Have a 6×2 structure array I can set data to the first column in the array by setting the index to 1…6. I tried to set index 7 but then the structure array is changed to a array with dimensions of 7×2.
What should I do to populate the second column of the array? Thank You Joachim
Best Answer