fh = localfunctions()
| Parameter | Description |
|---|---|
| fh | a cell array of function handles. |
localfunctions returns a cell array of handles to local functions defined in the current file.
If the current context is not a file with local functions, the result is an empty cell array.
fh = localfunctions()
isequal(fh, {})
% Save this code in a file named localfunctions_demo.m:
%
% function names = localfunctions_demo()
% fh = localfunctions();
% names = {func2str(fh{1}); func2str(fh{2})};
% disp(fh{1}(3))
% disp(fh{2}(3))
% end
%
% function y = add_one(x)
% y = x + 1;
% end
%
% function y = double_value(x)
% y = 2 * x;
% end
names = localfunctions_demo()
% Expected names:
% {'add_one'; 'double_value'}
| Version | Description |
|---|---|
| 1.0.0 | initial version |