Is there a function that will test if the input is char OR string OR cellstr?
조회 수: 91 (최근 30일)
이전 댓글 표시
Given many MatLab functions can easily handle strings, cellstrings and char arrays in their stride, is there a function which allows me to test if my variable is any of these?
I am aware that a simple function would be
function output = isText(myVar)
output = isstring(myVar)||ischar(myVar)||iscellstr(myVar);
end
but I feel like there should already by a function for this which is highly optimised?
I am sorry if this has been asked before, but if it has, the keywords are so used that this question is nowhere to be seen.
댓글 수: 0
답변 (2개)
Fangjun Jiang
2020년 7월 2일
You've made that function. If you look at the "See also" section of "help iscellstr", you don't see any other related functions.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Characters and Strings에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!