I read the matlab help on it and still have some questions-
with strings in the cell array- I want to enter to just the first two chars of the string, how can I do that?
'anscell{1,1}= '
'LThand.jpg'
'aa1=strcmp('LT',anscell{1:5,1}(1:2));'
because for now I get an error-
Bad cell reference operation.
'Error in a (line 5)'
aa1=strcmp({'LT'},anscell{1:5,1}(1:2));
anscellonly has one element, which contains the string.Thus, you should write
An alternative way to only compare the first two characters is
Since
strncmpworks also on cell arrays, you can even drop the index, i.e.