char(2713) and fprintf('\x2713\n') don't show a checkmark in the command window

조회 수: 13(최근 30일)
According to, the unicode for a checkmark is 2713. However, `char(2713)` doesn't show a checkmark in the command window. It shows a question mark with a box around it. If I copy and paste it into Vim or Word, it shows up as a capital `S` with a smudge in the upper circle.
I also tried `fprintf('\x2713\n')`, which also printed a question mark inside a box.
Is there anyway to get a checkmark? (I am using Matlab 2019a)
I eventually want the checkmark to show when I copy and paste it into Vim or Word. Funnily enough I can enter unicode 2713 into Vim and get a checkmark. In Insert mode, press ctrl+V followed by `u2713` without quotes.
P.P.S. I can't even copy and paste the checkmark from Vim to the MATLAB command window. It shows up as a question mark within a box. Same if I try to paste it within single quotes to create a char array.

채택된 답변

Stephen23 2022년 3월 29일
편집: Stephen23 2022년 3월 29일
"According to, the unicode for a checkmark is 2713."
Sure, lets try it using both FPRINTF and CHAR:
✓ ✓
"However, `char(2713)` doesn't show a checkmark in the command window."
Nor should it. Hexadecimal x2713 converts to decimal 10003, which is the correct value to use with CHAR.
The incorrect decimal value that you tried converts to... hexadecimal xA99, aka U+0A99, which is the Gujarati Letter Nga, and looks like this:
So far everything seems to be working exactly as expected.
However you are very unlikely to get any meaningful characters if you keep mixing up decimal and hexadecimal.
  댓글 수: 8
FM 2022년 3월 29일
I appreciate the suggestion, but will chose to work around the inability to display checkmarks. It is more important that I be able to view the command window in a way that I find to be most helpful for focusing. Eventually, I'm going to copy and paste the text elsewhere anyway, so if my solution is so fragile as to require a certain font, it's a nonstarter. I chose to use the plain alphabetic letter "Y" instead of a checkmark. Thanks!

댓글을 달려면 로그인하십시오.

추가 답변(1개)

KSSV 2022년 3월 29일
편집: KSSV 2022년 3월 29일
How about using sprintf.
s = sprintf('\x2713')
s = '✓'
  댓글 수: 3
FM 2022년 3월 30일
I wouldn't want to change fonts, so I consider the wish for a checkmark in the command window to be not a good idea. Thanks.

댓글을 달려면 로그인하십시오.


Find more on Data Type Conversion in Help Center and File Exchange




Community Treasure Hunt

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

Start Hunting!

Translated by