Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
TeX string incomplete?!

Subject: TeX string incomplete?!

From: Armin Mueller

Date: 28 Jan, 2009 16:36:46

Message: 1 of 4

This is a multi-part message in MIME format.
--------------020202000903000909070109
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Hello all,

here is a small program that will issue a warning in R2008b. I don't
understand why, because I chose 'none' as 'Interpreter'.

Warning: incomplete command in TeX text string:
'Luft40ms_D40_25mm2s_Sirene_250Hz_'
 > In legendcolorbarlayout>doLayoutCB at 283
   In title at 46
   In title at 23
   In title_bug at 15

The isolated code line is running without warning:

 >> title('Luft40ms_D40_25mm2s_Sirene_250Hz_', 'Interpreter', 'none')

Where is the difference? Any hints?

Thanks!
Armin

--------------020202000903000909070109
Content-Type: text/plain;
 name="title_bug.m"
Content-Transfer-Encoding: 8bit
Content-Disposition: inline;
 filename="title_bug.m"

function title_bug

l_vel12A_mean = rand(1, 24);
n = 0:15:345;

prefix = 'Luft40ms_D40_25mm2s_Sirene_250Hz_';

figure
plot([n 360], [l_vel12A_mean l_vel12A_mean(1)], 'r.-')
xlabel('Phasenwinkel \phi [

Subject: TeX string incomplete?!

From: us

Date: 28 Jan, 2009 17:00:20

Message: 2 of 4

Armin Mueller
> here is a small program that will issue a warning in R2008b. I don't
> understand why, because I chose 'none' as 'Interpreter'.

you should report this bug...

% the bug
% - 1. legend
% - 2. title
     s='ERROR_';
     plot(1:2);
     legend('error');
     title(s,'interpreter','none');
%{
Warning: incomplete command in TeX text string:
'ERROR_'
> In legendcolorbarlayout>doLayoutCB at 283
  In title at 46
  In title at 23
%}

     pause;
% a workaround
% - 1. title
% - 2. legend
     clf;
     s='OK_';
     plot(1:2);
     title(s,'interpreter','none');
     legend('ok');

us

Subject: TeX string incomplete?!

From: Armin Mueller

Date: 28 Jan, 2009 21:19:24

Message: 3 of 4

us wrote:

> you should report this bug...

Yes, right. Done.

Cheers,
Armin

Subject: TeX string incomplete?!

From: Luuk

Date: 11 Mar, 2013 21:55:06

Message: 4 of 4

Armin Mueller <arm.in@web.de> wrote in message <glqi4r$fv2$1@news4.rz.uni-karlsruhe.de>...
> us wrote:
>
> > you should report this bug...
>
> Yes, right. Done.
>
> Cheers,
> Armin

The source of the problem is the '_' sign in the string which you put in your title. I had the same problem (so I got here), and solved it by discarding the _ from the string.
If you want to use the underscore, you should probably use the TeX command \textunderscore for it (http://www.tex.ac.uk/cgi-bin/texfaq2html?label=underscore)
I'm not sure how exactly to use TeX in plots, but it should be explained here: http://www.mathworks.nl/help/matlab/ref/texlabel.html

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us