"anant naishadham" wrote in message <itbvud$48f$1@newscl01ah.mathworks.com>...
> hi,
> i'm trying to find cluster centers in an image.
> when i go to a new pixel. i try to check if that pixel is a cluster center by checking all the pixels around it . if it is not and then i just flag the pixel as one that i've already visited in the image.
> my problem is that when i try to check a certain pixel wether it has already been visited by the following statement:
> if(any(tt(1:k,1)==position_pixel(t,1))==1)
> if(any(tt(1:k,2)==position_pixel(t,2))==1)
>
> position_pixel gives the present pixel that is under consideration:
> t is a counter that gives the row vector position
> column vector 1 stores x position of the pixel where as column vector 2 stores the y vector position.
>
> 'tt' stores all the pixels that have already been visited.
> column vector 1 and 2 of the 'tt' array also store the x aand y pixel postions respectively
> k gives the number of rows of the 'tt' that have been written with the pixel values since i have previously declared 'tt' as 'tt=zeros(1000,2);'
>
>
> while doing so i'm getting an error as follows:
> ??? Error using ==> eq
> Matrix dimensions must agree.
>
> while i just compare one element of the t array with all the elements of the 'tt ' array.. i'm not able to understand how this problem can be solved. help!
Hi,
Check if the k or t are scalars. Perhaps some mistake in the code could have made them into vectors, i that case, you would be getting this error.
hth
Krishna
