필터 지우기
필터 지우기

Matlab publish to pdf unicode characters print statements

조회 수: 29 (최근 30일)
Brandon
Brandon 2024년 7월 9일 18:50
댓글: Brandon 2024년 7월 10일 16:31
I am trying to publish my code to pdf and use unicode characters as mathmatical variables. A simplified example would be:
% delta
fprintf('\x03B4\n')
Output:
δ
I would like this to show up in the published pdf but the output is replaced with '#' instead.

답변 (1개)

Bhanu Prakash
Bhanu Prakash 2024년 7월 10일 4:47
Hi Brandon,
This issue might occur if MATLAB didn't interpret the unicode properly. Instead you can use either of the following two commands to get the output as 'δ':
fprintf('%s\n', char(0x03B4)) % command-1
fprintf('%s\n', char(hex2dec('03B4'))) % command-2 using hex2dec
For more information on the 'hex2dec' funciton, you can refer to the following documentation:
Hope this helps!
  댓글 수: 1
Brandon
Brandon 2024년 7월 10일 16:31
They do both output correctly to the command window but unfortunately they do not publish in the pdf form. MATLAB seems to interpret the unicode properly only when outputting to the command window and not when publishing and idk why.

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

카테고리

Help CenterFile Exchange에서 Tables에 대해 자세히 알아보기

태그

제품


릴리스

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by