필터 지우기
필터 지우기

Converting matrix into string

조회 수: 1 (최근 30일)
Vivek Bhadouria
Vivek Bhadouria 2011년 8월 14일
Hello everyone,
I am having a matrix of dimension [20*11] as [0 0 0 0 0 0 0 0 0 1 0;1 0 0 0 0 0 0 0 0 0 0;............] and I am trying to convert this matrix as string in the dimension [20*1] as [00000000010;10000000000;............]. Please help me how to do this.

채택된 답변

Walter Roberson
Walter Roberson 2011년 8월 14일
You cannot do that. Strings are inherently arrays of characters, so the string 'ABC' does not have dimension 1 x 1, it has dimension 1 x 3.
What you can do, if your matrix is named X (for example) is
char(X + '0')
That will create a 20 x 11 character matrix with the first row '00000000010' and so on.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Data Type Conversion에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by