matlab引用m文件路径,[转载]matlab代码中获取当前m文件所在的路径 转的
%save m-file as aa.mfunction res=aa()clcp1 = mfilename('fullpath')i=findstr(p1,'')p1=p1(1:i(end))cd(p1)endmfilenameFile name of currently running functionSyntaxmfilenamep = mfilename('fullpath')c = mf...