What's wrong with -> ??? Error using ==> vertcat
조회 수: 1 (최근 30일)
이전 댓글 표시
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
Iman Ansari
2013년 4월 12일
편집: Iman Ansari
2013년 4월 12일
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?
답변 (1개)
Walter Roberson
2013년 4월 12일
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
참고 항목
카테고리
Help Center 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!