array of symbols
조회 수: 1 (최근 30일)
이전 댓글 표시
hi,
i have this code:
data=[11 10 200];
for i=1:3
k2=1;
x = dec2bin(data(i), 10)
y = transpose(reshape(x, 5, 2))
y1=bin2dec(y)
aa(1)=int2aa(y1(1));
aa(2)=int2aa(y1(2));
aa1=[aa(1) aa(2)]
s1(i)={aa1};
end
the output:
s1 =
'?L' '?I' 'QG'
I want the output be:
s1=[?L,?I,QG];
how get that?
thanks
댓글 수: 0
답변 (1개)
Walter Roberson
2011년 11월 28일
You cannot get that. The closest you could get would be ['?L';'?I';'QG'] . The code change for that would be to use
s1(i,:)=aa1;
Strings in MATLAB are row vectors of characters, and cannot be stored in an array as individual entities.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!