In an assignment A(:) = B, the number of elements in A and B must be the same
Show older comments
Can you please help me to correct the above mentioned problem in the following matlab code ?
E = [5,200]; Selected edge values
X = imread('LENNA128.bmp');
N = length(X);
Y = false(N+2);
for k = 1:numel(E);
Y(2:end-1,2:end-1) = X==E(k);
Z = Y(1:end-2,2:end-1) | Y(3:end,2:end-1) | Y(2:end-1,3:end) | Y(2:end-1,1:end-2);
X(Z) = round((X(end-3,3:end-2) + X(end-3,4:end-1))/2);
end
The 'entire' error message is:
In an assignment A(:) = B, the number of elements in A and B must be the same.

Accepted Answer
More Answers (0)
Categories
Find more on Convert Image Type in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!