Help: "Error using horzcat, CAT arguments are not consistent"
Mostrar comentarios más antiguos
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!
Respuestas (1)
Walter Roberson
el 4 de Abr. de 2013
0 votos
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.
Categorías
Más información sobre Logical en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!