Call Local Functions Using Function Handles - MATLAB & Simulink
www.mathworks.com › help › matlabThe function returns a struct with handles to the local functions. % Copyright 2015 The MathWorks, Inc. function fh = ellipseVals fh.focus = @computeFocus; fh.eccentricity = @computeEccentricity; fh.area = @computeArea; end function f = computeFocus(a,b) f = sqrt(a^2-b^2); end function e = computeEccentricity(a,b) f = computeFocus(a,b); e = f/a; end function ae = computeArea(a,b) ae = pi*a*b; end
Local Functions - MATLAB & Simulink
www.mathworks.com › help › matlabMATLAB ® program files can contain code for more than one function. In a function file, the first function in the file is called the main function. This function is visible to functions in other files, or you can call it from the command line. Additional functions within the file are called local functions, and they can occur in any order after the main function.