double - type matrix with integer and char values
조회 수: 3 (최근 30일)
이전 댓글 표시
Hi, I would know if it's possible create a matrix with two columns where in the first one we have integer values while in the second one i would save character values. Thanks for the answers.
댓글 수: 0
채택된 답변
Star Strider
2014년 6월 2일
편집: Star Strider
2014년 6월 2일
You can easily do that with a cell array, but not a matrix. Matrices have to have only one data type.
For instance:
for k1 = 1:10
C{k1,1} = k1;
C{k1,2} = char(61+k1);
end
The character array can be anything you want (single letters or symbols here only for demonstration purposes).
추가 답변 (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!