validate function inputs independent of position and name
Afficher commentaires plus anciens
Dear All,
I have the function f(a b c d), with a b c d inputs all structure arrays, a and b required, c and d optional. I want to validate inputs based on that a b c d are all structures (this may be redundant, see next), and/or more specifically, based on the name of some specific fields for each of the a b c d inputs, say a.fielda, b.fieldb, c.fieldc, and d.fieldd, but not the position or name of the arrays themselves (eg a b c d). Additionally, since my code uses C as intermediate, then output variable for input c, I want to make sure that if the name of c input is C, the validation will generate an error message, as I do not want c to be modified (the principle of input argument preservation). Please advise, I got stuck with using inputparser and validateattributes, I would appreciate some hands on example using info herein. Thank you,
Octavio.
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Structures dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!