Functions istext iscelltext
Most function now allow either char of string variables.
However missing are functions to test for either string or char,
and to test for a cell array containing only string or char values.
Two functions v=istext(x) and v=iscelltext(x) are included or
can be used inline as:
istext=@(x)isstring(x)|ischar(x);
iscelltext=@(x)all(cellfun(@(y)isstring(y)|ischar(y),x,'UniformOutput',1));
Cite As
Bill Whiten (2024). Functions istext iscelltext (https://www.mathworks.com/matlabcentral/fileexchange/68918-functions-istext-iscelltext), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxCategories
Tags
Acknowledgements
Inspired: Optional function arguments
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
istext_iscelltext
Version | Published | Release Notes | |
---|---|---|---|
1.0.0 |