You can use this one line function (tested only on Unix like systems):
function pathOut = fullpath(pathIn)
[status pathOut] = system(sprintf('TEMP=$PWD; cd "%s"; echo $PWD; cd $TEMP;', pathIn));
return
For example, suppose that the current directory is /Users/zuliani/Documents/Temp. Then:
octave:1> fullpath('.')
ans = /Users/zuliani/Documents/Temp
octave:2> fullpath('../../Documents/')
ans = /Users/zuliani/Documents