is_calledby(func_na​me)

Returns 1 if the active function has a parent; else returns 0. Also tests for specific parent names.
92 descargas
Actualizado 23 jun 2015

Ver licencia

out = is_calledby(func_name)
OVERVIEW
Tests identify of parent (calling) functions. Returns 1 if the active
function has a parent function calling it; else returns 0. Also tests
for specific parent names.
FORMS
[out] = is_calledby
[out] = is_calledby(func_name)
DESCRIPTION
[out] = is_calledby
Returns 1 if the active function has a parent; otherwise
returns 0.
[out] = is_calledby(func_name)
Returns 1 if the active function's parent matches func_name;
otherwise returns 0.

INPUTS
func_name - string indicating the name of a function. Set
func_name='*' to return 1 for being called by any function.

OUTPUTS
out - returns 1 or 0

EXAMPLES
Example 1
is_calledby % Returns 0

Example 2
% Drop this into a script called test1.m
function test1
is_calledby % Returns 0
fprintf('Should return 0 \n');

is_calledby('*') % Returns 0
fprintf('Should return 0 \n');
test2
end
function test2
is_calledby % Returns 1
fprintf('Should return 1 \n');

is_calledby('*') % Returns 1
fprintf('Should return 1 \n');

is_calledby('asdfasdf') % Returns 0
fprintf('Should return 0 \n');

is_calledby('test1') % Returns 1
fprintf('Should return 1 \n');
end
SEE ALSO
calledby
http://www.mathworks.com/matlabcentral/fileexchange/51281-calledby-depth-

Citar como

Dave Stanley (2024). is_calledby(func_name) (https://www.mathworks.com/matlabcentral/fileexchange/51280-is_calledby-func_name), MATLAB Central File Exchange. Recuperado .

Compatibilidad con la versión de MATLAB
Se creó con R2007a
Compatible con cualquier versión
Compatibilidad con las plataformas
Windows macOS Linux
Categorías
Más información sobre Test Scripts en Help Center y MATLAB Answers.
Etiquetas Añadir etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Versión Publicado Notas de la versión
1.1.0.0

Added link to partner function, calledby.m
Small improvement to documentation

1.0.0.0