Hello,
In my S-function written in C I use the function mexCallmatlab to plot the content of an array and it works as I want:
real_T Gain[205];
// Some code to fill the array Gain
// convert array to mxArray
mxArray* x_ptr_gain; // Pointer
x_ptr_gain = mxCreateDoubleMatrix(1, 205, mxREAL);
memcpy(mxGetPr(x_ptr_gain), Gain, sizeof(double)*205);
mexCallMATLAB(0,NULL,1,&x_ptr_gain,"plot");
Matlab plots on the y-axis the content of my array and on the x-axis the vector number 1,2…205.
Now I would like to have on the x-axis the content of an other vector freq, which has of course the same size than Gain:
What do I have to change to get want I want? I tried a few things, but as I am not very sure how all these structures work, I may have done mistakes and giving me the solution would be really nice :)
Thanks.