LaTeX valid interpreter error

1 visualización (últimos 30 días)
Justin Pehrson
Justin Pehrson el 29 de En. de 2021
Comentada: Justin Pehrson el 29 de En. de 2021
I'm trying to insert this into a figure and Matlab keeps giving me the 'String scalar or character vector must have valid interpreter syntax:' error
text(-8,75,'\[X=x+vt+\frac{1}{2}(at^2)\]','Interpreter','latex','FontSize',7,'FontName','Palentino Linotype','Color','black')
any help would be appreciated
I'm also using the online version of matlab, I don't know if that would make a difference

Respuesta aceptada

andre con
andre con el 29 de En. de 2021
Hi Justin,
You could try Latex code between $$. Below I have suggest a code that I have sure that work.
rgds
clc; clear all; close all;
x=0:5
plot(x,x)
text(1,1,'$X=x+vt+\frac{1}{2}(at^2)$','Interpreter','latex','FontSize',20,'FontName','Palentino Linotype','Color','black')
  3 comentarios
Walter Roberson
Walter Roberson el 29 de En. de 2021
Note: this is not enough to be able to use [ and ] .
Justin Pehrson
Justin Pehrson el 29 de En. de 2021
I used an online converter to get the latex format, I didn't need the brackets but they were put there anyways

Iniciar sesión para comentar.

Más respuestas (1)

Walter Roberson
Walter Roberson el 29 de En. de 2021
text(-8,75,'$\left[X=x+vt+\frac{1}{2}(at^2)\right]$','Interpreter','latex','FontSize',7,'FontName','Palentino Linotype','Color','black')

Categorías

Más información sobre Printing and Saving en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by