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

6 Ansichten (letzte 30 Tage)
Dominik Deml
Dominik Deml am 1 Mai 2023
Kommentiert: Star Strider am 1 Mai 2023
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:

Antworten (1)

VBBV
VBBV am 1 Mai 2023
Bearbeitet: VBBV am 1 Mai 2023
add another preceding \ as below
xlabel('Zeit $(SI[\\s]$)', 'Interpreter', 'latex');
  4 Kommentare
Dominik Deml
Dominik Deml am 1 Mai 2023
So there is no way of doing this?
Star Strider
Star Strider am 1 Mai 2023
You will need to be creative!

Melden Sie sich an, um zu kommentieren.

Community Treasure Hunt

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

Start Hunting!

Translated by