HOW TO STRİNG TO CHAR

5 ビュー (過去 30 日間)
Gökhan BAYKARA
Gökhan BAYKARA 2020 年 5 月 2 日
コメント済み: Image Analyst 2020 年 5 月 2 日
how do I print this expression''110 011101110001111001111010 1111000001000100011011000111010'' in a matrix of 10x10?

採用された回答

Image Analyst
Image Analyst 2020 年 5 月 2 日
You can't. It's only 58 characters long - 60 if you include the spaces:
expression = "1100111011100011110011110101111000001000100011011000111010"
length(expression)
length(char(expression))
expression =
"1100111011100011110011110101111000001000100011011000111010"
ans =
1
ans =
58
In the meantime, try
expression = "1100111011100011110011110101111000001000100011011000111010"
length(expression)
charVector = char(expression)
length(charVector)
charMatrix = reshape(charVector, 2, 29) % or 10 by 10
  4 件のコメント
Gökhan BAYKARA
Gökhan BAYKARA 2020 年 5 月 2 日
n your result vector, your value of 1 for the name length and 10 for the number will be fixed and will not change. But everyone's name is different because it is long; BINARY will be stored in the 5-bit data of the vector since SAHIN in the sample name has 5 values The total length in the format will be 5x (1 + 5 + 10) = 80 characters. Occupation in total, considering your name to be up to 9 characters Since the number of characters you can get is 5 * (1 + 9 + 10) = 100, in the 10x10 matrix, 0 * for your 0 values ​​in your result vector, 1 You can create your QR code to print '' (space) for its values. NOTE: Since 80 characters are occupied for the name given in the example, the remaining places in the matrix are blank "*" will be printed. QR code for the sample given:
Image Analyst
Image Analyst 2020 年 5 月 2 日
Is this homework? Because it looks like it and we don't want you to get into trouble by submitting my answer as your own. Please read this link.

サインインしてコメントする。

その他の回答 (1 件)

Gökhan BAYKARA
Gökhan BAYKARA 2020 年 5 月 2 日
n your result vector, your value of 1 for the name length and 10 for the number will be fixed and will not change. But everyone's name is different because it is long; BINARY will be stored in the 5-bit data of the vector since SAHIN in the sample name has 5 values The total length in the format will be 5x (1 + 5 + 10) = 80 characters. Occupation in total, considering your name to be up to 9 characters Since the number of characters you can get is 5 * (1 + 9 + 10) = 100, in the 10x10 matrix, 0 * for your 0 values ​​in your result vector, 1 You can create your QR code to print '' (space) for its values. NOTE: Since 80 characters are occupied for the name given in the example, the remaining places in the matrix are blank "*" will be printed. QR code for the sample given:

カテゴリ

Help Center および File ExchangeEntering Commands についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by