Help: "Error using horzcat, CAT arguments are not consistent"
Afficher commentaires plus anciens
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!
Réponses (1)
Walter Roberson
le 4 Avr 2013
0 votes
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.
Catégories
En savoir plus sur Logical dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!