MATLAB: Is it possible to call a subfunction inside a function mscript

embedded matlab functionfunction

Is it possible to call a subfunction inside a mscript function and get the returned value?
e.g., the content of 'func.m' as below
function b = func(a)
b = subfunc(a) +1;
function c = subfunc(a)
c = a*2;
Can I call subfunc directly in the matlab workspace.

Best Answer

No. You have to create a separate mfile that can be called by your mscript.