How can I use integer inputs to a Fortran MEX-file in MATLAB?

1 回表示 (過去 30 日間)
MathWorks Support Team
MathWorks Support Team 2010 年 7 月 14 日
I would like to write a Fortran MEX-file that accepts integer values for input. I cannot find an example in the documentation that shows how to do this.

採用された回答

MathWorks Support Team
MathWorks Support Team 2010 年 7 月 14 日
This change has been incorporated into the documentation in Release 2010a (R2010a). For previous releases, read below for any additional information:
Documentation on using integer inputs to a Fortran MEX-file is missing from MATLAB.
Download the attached Fortran MEX-file for example code. To run the example:
1. Set up your Fortran compiler:
mex -setup
2. Compile the downloaded Fortran MEX-file using the compiler from step 1, above:
mex xtyint.f
3. Execute the example:
x = int32(7)
y = int32(1:100)
z = xtyint(x, y)

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeFortran with MATLAB についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by