I got error, dimesion mismatch, what does this mean? please help
이전 댓글 표시
A = zeros(10,10)
A(1,1) = 'Story'
A(1,2) = 'Force'
A(2,1) = 1
A(3,1) = 3
.
.
etc
??? Subscripted assignment dimension mismatch.
Error in ==> Program at 21 my_result(n+2,1) = 'Story'
Im willing to ceate a table which is contain letters or words and numbers, is it possible? if, its possible could you please help me to fix that error message.
I will appreciate your help
Thanks
채택된 답변
추가 답변 (2개)
Walter Roberson
2013년 6월 7일
It is not possible to create a numeric array that contains a combination of letters and numeric values. The closest you can get is to use a cell array.
A = cell(10,10);
A{1,1} = 'Story';
A{1,2) = 'Force';
A{2,1} = 1;
A(3,1) = 3;
Notice the use of {} instead of ()
댓글 수: 3
Walter Roberson
2013년 6월 7일
A(2:10,2) = num2cell(1:1:9);
Notice this goes back to () not {}
Andrei Bobrov
2013년 6월 7일
See my answer.
Brwa
2013년 6월 7일
카테고리
도움말 센터 및 File Exchange에서 Logical에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!