Strin=strcat(strFirst,"_",strLast);
Because you used "_" the result you get is going to be a string object, not a character vector.
strfind() returns positions inside the scalar string object
Positions inside a scalar string object are not the same thing as indices into the string object. A scalar string object has index 1 only -- the index for a string object is which complete string you are accessing. Like ["hello", "bye"] has indices 1 for "hello" and 2 for "bye".
1 Comment
Bhaskar R (view profile)
Direct link to this comment
https://ww2.mathworks.cn/matlabcentral/answers/491512-why-it-said-that-matrix-index-is-out-of-range-for-deletion#comment_768138
Sign in to comment.