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: simple mex file issue
Replies: 4   Last Post: Jul 22, 2011 3:46 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Mateusz Gos

Posts: 32
Registered: 12/8/08
Re: simple mex file issue
Posted: Jul 20, 2011 8:53 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

PS - I might add that trying to put the WHICH or PWD command into the mex file will not work. it has to be a directory of some sort, not a MATLAB command

"Mateusz Gos" <> wrote in message <j07s80$d5e$>...
> First of all - thank you very much Jan.
> Addressing your first question - what I meant is that the COMPILED mex file is using additional files to perform calculations for given inputs. Please trust me this is the best way it could be arranged (and it works nicely as long as these files stay in the designated subfolder in which case the hardcoded path is say 'addFiles\').
> Thank you for the clarification. The reson why I was thinking about something like '.\' was because it MUST be flaxible. Finding the directory using PWD or WHICH will not help in this case because it will only be valid on a given, single machine and this mex file must work also when moved to a different computer. I thought if I put everything to one folder and tell mex file to use 'same directory as it is in, whatever it may be' it will solve the problem.
> Any idea how to do it?
> Thank you in advance,
> Mat
> "Jan Simon" wrote in message <j07ne6$1rd$>...

> > Dear Mateusz,
> >

> > > I am compiling a mexw32 file from an .f90 file. The mexw32 uses additional files.
> >
> > Does this mean that the Mex reads any data from a file? Or are the files needed for the compilation?
> >

> > > Problem I have is that I must put the additional files in the same directory as the mexw32 file, so the hardcoded path must point into the 'current' folder.
> >
> > The current folder is *not* the parent folder of the Mex file. You can use WHICH to determine the parent folder of a function. But there should be a better location to store data.
> >
> > Kind regards, Jan

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.