??? Error using ==> vertcat CAT arguments dimensions are not consistent.

1 次查看(过去 30 天)
i want a help to figure out this error named
??? Error using ==> vertcat
CAT arguments dimensions are not consistent.
in these specific lines
for j = 2:n-1
a1 = [difference_red(i-1,j-1) difference_red(i-1,j) difference_red(i-1,j+1) difference_red(i,j-1) difference_red(i,j) difference_red(i,j+1) difference_red(i+1,j-1) difference_red(i+1,j) difference_red(i+1,j+1)];
b1 = [difference_blue(i-1,j-1) difference_blue(i-1,j) difference_blue(i-1,j+1) difference_blue(i,j-1) difference_blue(i,j) difference_blue(i,j+1)
difference_blue(i+1,j-1) difference_blue(i+1,j) difference_blue(i+1,j+1)];
c1 = [difference_green(i-1,j-1) difference_green(i-1,j) difference_green(i-1,j+1) difference_green(i,j-1) difference_green(i,j) difference_green(i,j+1) difference_green(i+1,j-1) difference_green(i+1,j) difference_green(i+1,j+1)];
a2 = a1(a1<=0.7);
b2 = b1 (b1<= 0.7);
c2 = c1 (c1<=0.7);
med_red (i,j)= median (a2);
med_blue (i,j)= median (b2);
med_green (i,j)= median (g2);
end

回答(2 个)

Jan
Jan 2011-10-7
Please post the line in which the error occurs.
The VERTCAT command is called implicitely if you use "[...]". I guess you have a linebreak inside, which is interpreted as a semicolon (ugly!). Then use this notation: a1 = [difference_red(i-1,j-1), difference_red(i-1,j), ... difference_red(i+1,j+1)]; Insert commas and use the line continuation "...".

prem preet
prem preet 2011-10-7
thnx for your suggestion ... i appreciate it ...
  1 个评论
Jan
Jan 2011-10-7
Does it solve your problem? Then accepting the answer would be the signal, that others do not have to help anymore.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Image Filtering and Enhancement 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by