How to suppress message of validatestring?
1 view (last 30 days)
Show older comments
per isakson
on 1 Mar 2018
Commented: Steven Lord
on 1 Mar 2018
z = validatestring( 'azaa', {'aaa','bbb'} );
outputs in red to the Command Window
Expected input to match one of these strings:
'aaa', 'bbb'
The input, 'azaa', did not match any of the valid strings.
Is there a way to suppress this message?
I would like to get this information in an output argument and take control over the presentation.
I reckon it's straight forward to make my own version of validatestring and shadow the factory version.
0 Comments
Accepted Answer
Walter Roberson
on 1 Mar 2018
validatestring() is mostly a whole lot of throw(), so if you do not want the message, put in a catch
2 Comments
Steven Lord
on 1 Mar 2018
No, break exits a for or while loop. You want to go outside and play a game of catch :)
More Answers (0)
See Also
Categories
Find more on Argument Definitions in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!