Date: Jul 20, 2011 8:53 PM
Author: Mateusz Gos
Subject: Re: simple mex file issue

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" <webmaster24@wp.pl> wrote in message <j07s80$d5e$1@newscl01ah.mathworks.com>...
> 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$1@newscl01ah.mathworks.com>...

> > 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