|
回复 7楼 sunbojun0130 的帖子
LZ help下char
char(X) converts the array X that contains nonnegative integers representing character codes into a MATLAB character array. The actual characters displayed depend on the character encoding scheme for a given font. The result for any elements of X outside the range from 0 to 65535 is not defined (and can vary from platform to platform). Use double to convert a character array into its numeric codes.
或许这样较清楚
aa=dec2bin(3,3); % aa='011' - 1*3 char
bb=double(aa); % bb=[48,49,49] - 1*3 double
cc=bb-48; % cc=[0,1,1] - 1*3 double; bb-48等同bb-[48,48,48] |
|