Filter löschen
Filter löschen

Issue with latex interpreter plot/chart title

1 Ansicht (letzte 30 Tage)
Turbulence Analysis
Turbulence Analysis am 11 Feb. 2022
Hi, I would like to assign plot title as follows Y_10mm_X = num2str(b2(i)). where i = 0.78
For this, I tried as follows
title(['Y= 5mm_x =' num2str(b2(i)) ' mm'],'FontSize',20,'Color','black','Interpreter','latex')
However, I got teh below error..Please help me with this..
String scalar or character vector must have valid interpreter syntax:

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 11 Feb. 2022
Are you certain that you want the x to be a subscript of the second m ??
i = 1;
b2(i) = 0.78
b2 = 0.7800
title(['$Y= 5mm_x =' num2str(b2(i)) ' mm$'], 'FontSize', 20, 'Color', 'black', 'Interpreter', 'latex')
  3 Kommentare
Turbulence Analysis
Turbulence Analysis am 11 Feb. 2022
Sorry, not a subscript, But underscore like this Y = 5mm_x = 0.78 mm
Turbulence Analysis
Turbulence Analysis am 11 Feb. 2022
I figured out,, Now its Ok..
title(['$Y= 5mm\_{x} =' num2str(b2(i)) ' mm$'], 'FontSize', 20, 'Color', 'black', 'Interpreter', 'latex')

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu 2-D and 3-D Plots finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by