How do add a bar on top a letter while the letter also has a subscript

If I want to write the following expression on any xlabel or colorbar label:
How do I do this exactly? The following way to insert the above expression does not seem to work in MATLAB R2018 version!!!!
c2_bank_v6b2.Label.String = ["norm Prop Conc in the proppant bank" ...
"($\bar{c}$_{Prop} / $\bar{c}$_{PropMax})"];
Please and thanks. Mousumi

 Accepted Answer

'$\overline{C}_{Prop} / \overline{C}_{PropMax}$'

9 Comments

Hello Walter:
It didn't work! It looked like the following (as shown inside the circled portion of the image:
Any ideas!
Thanks. Mousumi
It looks to me as if you might not have specified 'interpreter', 'latex'
Hello, thanks for the tip! It worked once I stated the interpreter!
I have an additional question. What is the default FontName for everything (axis labels, legends and so on)?
Thanks. Mousumi
"The default font depends on the specific operating system and locale."
On my system:
>> get(0,'DefaultTextFontName')
ans =
'Helvetica'
Hello Walter:
Could you help me in converting the above equation (after all the bar on top and subscripts have been added) back in TeX form so that I can change the FontName?
In LaTeX mode, the text does not stand out!
Please and thanks. Mousumi
Are you sure you want to change the font and not the boldness?
You can change fonts within math mode to a limited extent. See https://tex.stackexchange.com/questions/58098/what-are-all-the-font-styles-i-can-use-in-math-mode but note that it can be difficult to add a package. The ones I can get to work are
\mathrm \mathit \mathnormal \mathcal
I do not seem to find a way that works outside of latex math mode. I see hints it should be possible in tex math mode, but I do not seem to be able to get the overbar to be recognized as a single command instead of being recognized as \o followed by verbar .
Actually, you are correct! I want to change the boldness, but also font type would be good too! Is there a quick way to bolden the equation above?
Accepted as Walter's answer and following responses comprehensively solve the problems posed.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!