Problem with using siunitx (latex) in xlabel, ylabel,

조회 수: 9 (최근 30일)
Dominik Deml
Dominik Deml 2023년 5월 1일
댓글: Star Strider 2023년 5월 1일
I want to use SI-Units in xlabel and ylabel. It should be interpreted as latex-text.
What I have tried so far:
xlabel('Zeit ($\unit{\second}$)', 'Interpreter', 'latex');
and
xlabel(['Zeit ', '$(\unit{\second})$'], 'Interpreter', 'latex');
Both ways don't work. I get the error:
String scalar or character vector must have valid interpreter syntax:

답변 (1개)

VBBV
VBBV 2023년 5월 1일
편집: VBBV 2023년 5월 1일
add another preceding \ as below
xlabel('Zeit $(SI[\\s]$)', 'Interpreter', 'latex');
  댓글 수: 4
Dominik Deml
Dominik Deml 2023년 5월 1일
So there is no way of doing this?
Star Strider
Star Strider 2023년 5월 1일
You will need to be creative!

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

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by