??? Error using ==> vertcat CAT arguments dimensions are not consistent.
2 次查看(过去 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
1 个评论
Jan
2011-10-7
Please use proper code formatting as explained in the link "Markup help" on this page.
回答(2 个)
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 "...".
0 个评论
prem preet
2011-10-7
1 个评论
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 Center 和 File Exchange 中查找有关 Fuzzy Logic in Simulink 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!