Problem with generate exterior border of regions

Dear colleagues,
I need to calculate the mean intensity of exterior border of regions. This regions are identified in a labels matrix called L. The number of regions is num=47.
For this purpose, I put in Matlab the following sentences:
pborde=strel('disk',3);
for k=1:num
pborde2(k)=imdilate((L==k),pborde);
Bext(k)=xor ((L==k),pborde2(k));
Bext(k)=double(Bext(k));
but Matlab give me the following error "Subscripted assignment dimension mismatch"
I have tested the same sentence but with k=47
pborde247=imdilate((L==47),pborde);
Bext47=xor ((L==47),pborde247);
Bext47=double(Bext47);
And It calculates correct. What is the problem? What sentences is wrong?
After solution this problem I calculate the mean intensity with the following order:
p2ext(k)=regionprops(Bext(k),yb,'MeanIntensity')
where yb is the original signal
Thank you vey much

1 Comment

dbstop if error
and then rerun your program. When the error is encountered, examine the steps one by one.

Sign in to comment.

Answers (0)

Asked:

on 6 Nov 2011

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!