how to use exist for a function that begins with an@
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Following @JanSimon's suggestion in this thread. I've defined a function name that starts with an @. But I'm running third-party code that uses `exist` to check the file-type. Unfortunately, `exist` throws an error in this case. To see the problem type
exist(@humps)
Is there a workaround for this?
4 commentaires
Stephen23
le 17 Fév 2018
Modifié(e) : Stephen23
le 17 Fév 2018
" My goal is purely to prevent matlab from crashing when it encounters the expression test(f) in the code"
What is test? You have not shown/explained how/where it is defined.
What is f? You have not shown/explained how/where it is defined.
So far it is not clear what you are trying to do. It would help us if you explained what you are trying to do, for example: "I have a function X defined in an Mfile which I am trying to supply to a function Y. However it throws an error, the complete text of which is 'Zzzzz zzz zzzz ... Zzzz zzz'", or whatever that explains your situation.
"The third-party code that I'm running is using exist as a device for checking whether the function is of type 2 or 6."
Sure, but how is this related to your question? Do you have such a file? Or not? How are we supposed to know? Your question only mentions that "I've defined a function name that starts with an @" (which is not possible), but nothing about what kind of function you have: is it the main function of an Mfile, or an anonymous function, or a handle to a local function (implied by your link to Jan Simon's answer)? So we have no idea how all of this hangs together.
Please describe the situation clearly.
Réponses (0)
Voir également
Catégories
En savoir plus sur Environment and Settings dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!