Borrar filtros
Borrar filtros

What's wrong with -> ??? Error using ==> vertcat

2 visualizaciones (últimos 30 días)
tedy
tedy el 12 de Abr. de 2013
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 comentario
Iman Ansari
Iman Ansari el 12 de Abr. de 2013
Editada: Iman Ansari el 12 de Abr. de 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?

Iniciar sesión para comentar.

Respuestas (1)

Walter Roberson
Walter Roberson el 12 de Abr. de 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.

Categorías

Más información sobre Logical en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by