From: Walter Roberson on
Samiov wrote:
> Walter Roberson <roberson(a)hushmail.com> wrote in message
> <O4RKn.10567$%u7.7652(a)newsfe14.iad>...

>> if leaving; break; end

> Thousands of thanks Walter!!! you really saved my life!!!! :)))
> Now it works as I want!!! It was just that thing that I looked
> for...

It is merely exactly the same thing you had been told several times
before, to use a flag to determine whether you had finished your loop.
From: dpb on
Samiov wrote:
> dpb <none(a)non.net> wrote in message
> <htgn7q$7ui$1(a)news.eternal-september.org>...
>> Samiov wrote:
>> ...
>>
>> > x2 = find(I(1:x1-2,y1)==1 & I(2:x1-1,y1) == 0, 1, 'last');
>> > y2 = find(I(x1,y1+2:col)==1 & I(x1,y1+1:col-1) == 0, 1,
>> 'last');
>> > I1 = I(x2:x1,y1:y2);
>> ...
>>
>> What is it you _really_ want, again?
>>
>> Unless for each column your x1:x2 extent is the same the result isn't
>> going to be a 2D array and the assignment above will abort on
>> mismatched array sizes unless you've created an I1 = zeros(size(I)) or
>> somesuch in which to contain the subimage.
>>
>> It still seems as though you could do this whole thing w/o the loops
>> or at least by simply processing the results of the find() operations
>> in a loop or two in a much more simplistic (and "Matlab'y") manner.
>> It appears you're trying to code in Matlab in a C or Fortran manner
>> instead of using the features of the language as designed.
>>
>> I'd harken back to Steve's message of "chill, dood; slow down and
>> _think_ a little"...
> __________________________________________________________
> Hi dpb,
> I've got the solution thanks to Walter

Well, I'd posted the same advice at least twice before as well as Walter
having done so as well...

--
From: Samiov on
yeah guys! I see what you mean now by the term "flag"... Sorry for insisting these two days..first I don't know too much the programming lexic & 2nd I don't speak well English..so I have problems of comprehension but I try my best to understand
Anyway thanks all of you for offering your help