From: Adrianna on
Hi,

I am trying to pass integer arrays through a mex wrapper to ifort. The arrays hold indices for a real array I will access.

Can someone post a sample of how to do this? I did not find example in the sample files. Another alternative would be to convert the real arrays to integers. I have yet to figure out how to do this. Samples of either would be a big help.

Thanks in advance.
From: James Tursa on
"Adrianna " <butterlfy20ad(a)yahoo.com> wrote in message <i0dsj1$bkl$1(a)fred.mathworks.com>...
> Hi,
>
> I am trying to pass integer arrays through a mex wrapper to ifort. The arrays hold indices for a real array I will access.
>
> Can someone post a sample of how to do this? I did not find example in the sample files. Another alternative would be to convert the real arrays to integers. I have yet to figure out how to do this. Samples of either would be a big help.
>
> Thanks in advance.

I can provide sample code, but first some clarification is needed.

What, specifically, do you mean by integer arrays? double class with integral values? Or one of the "int" classes, like int32?

Is your Fortran going to use the values as read-only? Or will you need to make a copy so you can modify them?

Will you be passing anything back to MATLAB? If so, what class do you want the return value to be?

Are you familiar with Fortran pointers?

James Tursa