MATLAB: Subscripted assignment dimension mismatch.

image processingMATLAB

I am trying to store the string in to one array in if else state ment. i get this error
Subscripted assignment dimension mismatch.
Error in connect (line 68) blob(i)='rectangle';

Best Answer

This error means that you are trying to assign to an element of vector blob (size 1x1) a vector a size 1x9. That happens because in MATLAB, a string is a vector of characters: 'rectangle' is a vector of size 1x9, but blob(i) has size 1x1.
Are you trying to store strings of various sizes in the variable blob? What do you want to do when storing strings in a vector?