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

### Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

New to MATLAB?

# Thread Subject: Multiline suplabel with latex

Subject: Multiline suplabel with latex

From: Anthony Hopf

### Anthony Hopf (view profile)

Date: 14 Oct, 2010 13:34:04

Message: 1 of 2

I can't seem to get this to work. I have a combination of variables and latex in a title I would like to put over several subplots.

I can't seem to get it to work, any ideas?

here is my code:
[supax, suph] = suplabel({'Reflectivity, Velocity and Spectrum Width';...%line one
['for a ',RADtype,' with \theta_{az}=',AZdeg,'^{o} and \theta_{el}=',ELdeg,'^{o}'];...%line two
['Rankine Profile V12 used with Reflectivity Ze_{max}= ',num2str(Zmax),...
' Vortex V_{mag} = ',num2str(vmag),' m/s and Core diameter = ',num2str(vdonut*2),' m']},'t');%line three

AZdeg and ELdeg are strings. This looks a little messy because of the wrapping in this text box.

Thank you

Subject: Multiline suplabel with latex

From: Anthony Hopf

### Anthony Hopf (view profile)

Date: 14 Oct, 2010 14:38:03

Message: 2 of 2

Saw this in the FEX comments by Lars:

Quite useful and simple to use. You might consider to change the argument checking to allow for cell strings (multi-line) labels:

if ~(ischar(text) || (iscell(text) && all(cellfun(@ischar,text))))
error('text must be a string or a cell string')
end
if ~ischar(whichLabel)
error('whichLabel must be a string')
end

Modified suplabel ->suplabel with this change and plotted very nicely.

I hope this isn't a violation of license.

"Anthony Hopf" <anthony.hopf@gmail.com> wrote in message <i970sc$7dd$1@fred.mathworks.com>...
> I can't seem to get this to work. I have a combination of variables and latex in a title I would like to put over several subplots.
>
> I can't seem to get it to work, any ideas?
>
> here is my code:
> [supax, suph] = suplabel({'Reflectivity, Velocity and Spectrum Width';...%line one
> ['for a ',RADtype,' with \theta_{az}=',AZdeg,'^{o} and \theta_{el}=',ELdeg,'^{o}'];...%line two
> ['Rankine Profile V12 used with Reflectivity Ze_{max}= ',num2str(Zmax),...
> ' Vortex V_{mag} = ',num2str(vmag),' m/s and Core diameter = ',num2str(vdonut*2),' m']},'t');%line three
>
> AZdeg and ELdeg are strings. This looks a little messy because of the wrapping in this text box.
>
> Thank you

## 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.