Info
This question is locked. Rouvrir pour modifier ou répondre.
How to check whether a name is a locally accessible function?
41 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Adil
le 24 Sep 2025 à 10:05
Locked: Steven Lord
le 27 Sep 2025 à 13:48
How to check whether a name is a locally accessible function and only locally accessible?
For example, with
function out = top_level_function(name)
% ???
function helper2
end
end
function helper1
end
Desired:
>> top_level_function('helper1')
>> ans =
1
>> otherwise_valid_function(); % executes
>> top_level_function('otherwise_valid_function')
>> ans =
0
isa(eval(['@',name]),'function_handle') with the necessary not file for [SL: removed spam link], not builtin check at the same time probably works in the case where there is no local name shadowing but I am also wondering if that can permit name to be evaluated as an expression without it being a function name. And also what to do when there is local name shadowing?
[SL: removed link that looked like spam]
0 commentaires
Réponse acceptée
Plus de réponses (0)
This question is locked.
Voir également
Catégories
En savoir plus sur Get Started with MATLAB dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!