Help: "Error using horzcat, CAT arguments are not consistent"
이전 댓글 표시
So I have two data sets, a and b.
a = [1
2]
b = [20 30]
I used transpose to make b in a column as well...
x = a;
y = b';
[x,y]
However, when I try to use [x,y] it gives me the horzcat error.
I typed whos x y just to make sure they were the same size after transposing b, and sure enough:
>>whos x y
Name Size Bytes Class Attributes
x 2x1 126 cell
y 2x1 16 double
Given that they are both 2x1, I don't understand why I'm getting this error!
Any help would be appreciated. Thank you!
답변 (1개)
Walter Roberson
2013년 4월 4일
0 개 추천
Why does it say that x is cell rather than double? You must have done something else to "x".
Your difficulty has to do with the rules for concatenating cell arrays together with numeric arrays: basically if you want to concatenate together a cell array and a numeric array, the cell array must be a vector.
카테고리
도움말 센터 및 File Exchange에서 Logical에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!