octave-maintainers
[Top][All Lists]

## Re: equivalent of fullfile (of matlab) in octave.

 From: etienne grossmann Subject: Re: equivalent of fullfile (of matlab) in octave. Date: Mon, 18 Oct 1999 20:12:43 +0100 (WEST)

  Hello

Lakshmi wrote:
> hi,
>  I have a problem in converting an octave equivalent code of matlab program.
>  In this program , I have to add a path in the program to get another
> function
> in the same directory.In matlab it is written as
>  curdir=pwd;

For "addpath", you may try the code in the attachment (oh, no! I
should be sending it to "octave-source"! But what if Lakshmi doesn't
subscribe to "octave-source"?)

> Could you please tell me what is the Matlab Equivalent of this addpath or
> fullfile.

For
fullfile(), you may try the following :

\begin{untested_code}

function s = fullfile(...)
s = "";
while nargin--,
s=[s,va_arg()];
end
t='';
while !strcmp(t,s),
t=s;
s=strrep(t,"/./","/");
s=strrep(s,"//","/");
end
end
endfunction

\end{untested_code}

Hope this helps,

Etienne