The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Software » comp.soft-sys.matlab

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: FORTRAN mex files
Replies: 1   Last Post: Jun 20, 1996 11:42 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Mr W P Brown

Posts: 1
Registered: 12/7/04
FORTRAN mex files
Posted: Jun 20, 1996 6:21 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Can anyone help me with the following problem? Please be patient as
I have to carefully explain what I am trying to do.

MATLAB version 4.2.
UNIX operating system.

I have a FORTRAN subroutine which requires three arguments to
read from a formatted ascii data file (data.dat). I've incorporated this
subroutine into a stand-alone program which compiles without any
problem. Upon execution, an array of numbers are produced.

I want to interface this FORTRAN subroutine with MATLAB.
I've amended and renamed the gateway program yprimeg.f
(provided as an example) in the following way:
1. commented out matrix creation for a return argument
2. commented out the statement which copies the output stored in the
local array to matrix output.

At the matlab prompt, typing,

!fmex file.f fileg.f


/usr/.../fmex[310]: 0: not found.
other subroutines:

(I get "/usr/.../fmex[310]: 0: not found." when I use yprime.f and
yprimeg.f. MATLAB accepts yprime(t,y) without any problems).

Yet, when I type file(a,b,c), MATLAB returns

FILE: /users/.../data.dat, UNIT: 1
( 0) 0xc11a166c io_ded + 0x37c [/usr/lib/.../]

Now I've included an "END=" specifier in the READ statement of the subroutine,
and the same error message is returned when I follow the above procedure.

The question is: if the stand-alone FORTRAN program compiles and runs without
any problems, and !fmex file.f fileg.f looks OK, then why does the program
fall over when I pass down the same arguments that I use in the stand-alone
FORTRAN program?

If this makes any sense and you can help, please email to the address below:

Thanks in advance,

W. Brown

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.