What's wrong with -> ??? Error using ==> vertcat
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hello,
i wanna ask, what's wrong with my code bellow?
data=[
1 1:1 2:2 3:2 4:2 5:2 6:2 7:2 8:2 9:2 10:2 11:2 12:2 13:2 14:2 15:2 16:3;
1 1:1 2:2 3:2 4:2 5:2 6:2 7:2 8:2 9:2 10:2 11:2 12:2 13:2 14:2 15:3 16:3;
2 1:1 2:1 3:1 4:1 5:1 6:1 7:1 8:1 9:1 10:1 11:1 12:1 13:1 14:3 15:3 16:3;
3 1:1 2:1 3:1 4:1 5:1 6:1 7:1 8:1 9:1 10:2 11:2 12:1 13:1 14:3 15:3 16:1];
it's so simple, but it result ??? Error using ==> vertcat CAT arguments dimensions are not consistent. is there something wrong? please help me. Thanks in advance
1 commentaire
Iman Ansari
le 12 Avr 2013
Modifié(e) : Iman Ansari
le 12 Avr 2013
the result is:
1 1 2
1 1 2
2 1
3 1
each row has different number of columns. What is 3:2 mean?
Réponses (1)
Walter Roberson
le 12 Avr 2013
first line: 1 is [1], 1:1 is [1], 2:2 is [2], 3:2 on to 16:3 are all [] (empty), so the first line is [1 1 2]
third line: 2 is [2], 1:1 is [1], 2:1 is empty, 3:1 through 16:3 are all [], so the third line is [2 1]. That is a different length than the first line.
0 commentaires
Voir également
Catégories
En savoir plus sur Logical dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!