Convert Fortran Arrays - MATLAB & Simulink (original) (raw)

Main Content

Convert array to pass by reference, not by value

Use these functions to convert between MATLAB® and Fortran types.

Fortran Functions

expand all

Real

mxCopyReal8ToPtr REAL*8 values from Fortran array to pointer array
mxCopyPtrToReal8 REAL*8 values from pointer array to Fortran array
mxCopyReal4ToPtr REAL*4 values from Fortran array to pointer array
mxCopyPtrToReal4 REAL*4 values from pointer array to Fortran array

Complex

mxCopyComplex16ToPtr COMPLEX*16 values from Fortran array to pointer array
mxCopyPtrToComplex16 COMPLEX*16 values from pointer array to Fortran array
mxCopyComplex8ToPtr COMPLEX*8 values from Fortran array to pointer array
mxCopyPtrToComplex8 COMPLEX*8 values from pointer array to Fortran array

Integer

mxCopyInteger4ToPtr INTEGER*4 values from Fortran array to pointer array
mxCopyPtrToInteger4 INTEGER*4 values from pointer array to Fortran array
mxCopyInteger2ToPtr INTEGER*2 values from Fortran array to pointer array
mxCopyPtrToInteger2 INTEGER*2 values from pointer array to Fortran array
mxCopyInteger1ToPtr INTEGER*1 values from Fortran array to pointer array
mxCopyPtrToInteger1 INTEGER*1 values from pointer array to Fortran array

Character

mxCopyCharacterToPtr CHARACTER values from Fortran array to pointer array
mxCopyPtrToCharacter CHARACTER values from pointer array to Fortran array
mxGetString mxChar array to C-style string or Fortrancharacter array

Pointer

mxCopyPtrToPtrArray Pointer values from pointer array to Fortran array

MathWorks - Domain Selector

Select a Web Site

Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .

You can also select a web site from the following list

How to Get Best Site Performance

Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.

Americas

Europe

Asia Pacific

Contact your local office