inputParser does not throw error
Afficher commentaires plus anciens
I want to check, whether an input is a string. Why does it not work?
p = inputParser() ;
isString = @(x) (isvector(x) | isempty(x)) & ischar(x) ;
addParameter(p, 'property_name', isString) ;
isString(13) % yields False
parse(p, 'property_name', 13) % Throws no error
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Argument Definitions 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!