Quoting Jordi Gutiérrez Hermoso <
address@hidden> on Tue, 8 Jan 2013 12:35:44 -0500:
WFM, what OS are you using and what Octave version?
address@hidden:~$ ./lol.m
ans = lol
ans = /home/jordi/lol
ans = /home/jordi/lol.m
address@hidden:~$ cat lol.m
#!/usr/local/bin/octave -q
mfilename
mfilename fullpath
mfilename fullpathext
- Jordi G. H.
Sorry I sent some nonsense in the last email I meant:
bash-4.1$ cat ./temp/lol.m
#! /home/s0237326/bin/share/bin/octave -qf
x = which(mfilename)
whos x
disp(which(mfilename))
bash-4.1$ ./temp/lol.m
x =
Variables in the current scope:
Attr Name Size Bytes Class
==== ==== ==== ===== =====
x 0x0 0 char
Total is 0 elements using 0 bytes
Do you really need to use "which"? From a quick look at it and Jordi's answer, it seems "mfilename fullpathext" gives the same result.
Michael.