MATLAB run , cd , .
:
% testcode.m
function [output] = testcode(fullfunctionpath, A, B)
[pathname, functionName] = fileparts(fullfunctionpath);
olddir = cd(pathname);
output = feval(functionName, A, B);
cd(olddir);
end
% .\test\testing.m
function [output] = testing(A, B)
output = A + B;
end
:
C = testcode('C:\testcode-matlab\test\testing.m', 1, 2);
C =
3
, , . , , MATLAB . . .