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

1 回表示 (過去 30 日間)
Mayss Aliyeh
Mayss Aliyeh 2017 年 5 月 6 日
コメント済み: Mayss Aliyeh 2017 年 5 月 6 日
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