필터 지우기
필터 지우기

Error using horzcat Dimensions of matrices being concatenated are not consistent.

조회 수: 1 (최근 30일)
Red = seg_img(:,:,1);
Green = seg_img(:,:,2);
Blue = seg_img(:,:,3);
[yRed, x] = imhist(Red,16);
[yGreen, y] = imhist(Green,16);
[yBlue, z] = imhist(Blue,16);
RedHist = [yRed,x];
GreenHist = [yGreen,y];
BlueHist = [yBlue,z];
figure
plot(x, yRed, 'Red', x, yGreen, 'Green', x, yBlue, 'Blue');
T = otsuthresh(yBlue);
BW = imbinarize(yBlue, T);
otsuRes = T;
CCV = getICCV(seg_img);
CCVres = CCV;
LBPresult = LBP(seg_img,1);
LBPres = LBPresult;
figure
imshow(LBPresult);
mapping=getmapping(8,'uint8');
[CLBP_SH,CLBP_MH]=clbp(seg_img,1,8,mapping,'h');
CLBPres = [CLBP_SH,CLBP_MH];
diseaseResults = [RedHist', GreenHist', BlueHist', otsuRes, CCVres', LBPres', CLBPres];
The error is in this line:
diseaseResults = [RedHist', GreenHist', BlueHist', otsuRes, CCVres', LBPres', CLBPres];
could anyone please help?
  댓글 수: 4
Stephen23
Stephen23 2017년 5월 6일
편집: Stephen23 2017년 5월 6일
"The size command didn't work because them all are in a variable in a mat file"
Well, by the time you use those variables in that last line (where the error occurs) they are certainly not in any mat file, so you can simply put the size commands to replace that line.
In any case, if the sizes that you have given are correct then there is noway that they could be concatenated together into one numeric array like that: their rows and columns are simply incompatible. What exactly do you intend to do with the variable diseaseResults? Depending on what you want to do with diseaseResults you might be able to use cell arrays.
Mayss Aliyeh
Mayss Aliyeh 2017년 5월 6일
I want to use it as my testing data in the machine learning multiclass SVM. How am I supposed to do them so??

댓글을 달려면 로그인하십시오.

답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by