what is difference between 124567891234567 vector and [1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 7] vector? how to convert 1234567891234567 vector into [1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 7]?
1 次查看(过去 30 天)
显示 更早的评论
matrix formed by 123456789 look like this
1234;
5678;
9123;
4567;
while matrix formed by
[1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 7]
look like
1 2 3 4;
5 6 7 8;
9 1 2 3;
4 5 6 7;
in first case bitwisexor and xor results are not true
1 个评论
per isakson
2017-10-21
1234567891234567
looks like a string array and
[1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 7]
looks like a numerical vector. Is that what you mean?
回答(1 个)
Walter Roberson
2017-10-21
The first one looks to me as if it would have been entered as '1234567891234567'. it looks to me as if the operation is
output = reshape(M, 4, 4).'
We do not know how the bitwise tests were coded.
'1234567891234567' is exactly the same in MATLAB as
['1' '2' '3' '4' '5' '6' '7' '8' '9' '1' '2' '3' '4' '5' '6' '7']
MATLAB uses 16 bit Unicode code points internally to represent characters. '1' is a character; its printed representation in any given font is a glyph https://glyphsapp.com/tutorials/unicode. What you see is the glyph, the picture representing the character; after parsing, '1' is the character, which is something that has particular meaning attached to it. The internal representation of the character associated with '1' is not the integer 1: it is the integer 49. ['1' '2' '3' '4' '5' '6' '7' '8' '9' '1' '2' '3' '4' '5' '6' '7'] in MATLAB is uint16([49 50 51 52 53 54 55 56 57 49 50 51 52 53 54 55]) but marked to be interpreted as character.
If you look at the history of mechanical alphabets such as https://en.wikipedia.org/wiki/Baudot_code you will see that historically the codes never used integer 0 for character '0', integer 1 for character '1' and so on. The codes were designed around matters such as operator fatigue and mechanical wear.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Cell Arrays 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!