From: jorge on
Hi.
How to get the root path for my application (guide)
For example:
d:\samples\code\start.m

How can I get the root whole path from code start.m while running start.m (without writting it like p='d:\samples\code\')
I want something like
p=getApplicationRootPath();
Thanks.
From: ImageAnalyst on
Did you check out the "mfilename" function?
From: jorge on
ImageAnalyst <imageanalyst(a)mailinator.com> wrote in message <f8958f1c-6951-46ca-9541-e0f5d11a236f(a)b21g2000vbh.googlegroups.com>...
> Did you check out the "mfilename" function?

You saved my life:). Thanks a lot!
From: ImageAnalyst on
Here's a handy little chunk of code that will prevent a bunch of
potential error messages, if you happen to run your macro with the
current working direction not being the directory where your m-file
lives:

% Change the current folder to the folder of this m-file.
% (The line of code below is from Brett Shoelson of The Mathworks.)
if(~isdeployed)
cd(fileparts(which(mfilename)));
end