How to use the power operator in xlabel?

Hi,
I want to add this xlabel to my figure: xlabel = ('A*R^(2/3) (m^(8/3))'). What my matlab does is instead of displaying the '^-sign' it places the first symbol after the operator in superscript, see figure attached. How can I overcome this problem (by either displaying the '^-sign' or by placing the entire term in superscript)?
Thanks, Marijn

 Respuesta aceptada

sixwwwwww
sixwwwwww el 7 de Dic. de 2013
use xlabel as below:
xlabel('A*R^(2/3) (m^(8/3))', 'Interpreter', 'none')

9 comentarios

Marijn
Marijn el 7 de Dic. de 2013
Thanks!
sixwwwwww
sixwwwwww el 7 de Dic. de 2013
you are welcome
Azzi Abdelmalek
Azzi Abdelmalek el 8 de Dic. de 2013
Editada: Azzi Abdelmalek el 8 de Dic. de 2013
Sixwwwwww, have you checked if this work?
sixwwwwww
sixwwwwww el 8 de Dic. de 2013
Yes it is working because user want to show exactly A*R^(2/3) (m^(8/3)) in the label instead of showing powers in super scripts. So that's why I used property 'Interpreter', 'none' so that MATLAB can't use its default property 'Interpreter', 'tex' to change the output display
Ok, it's also possible to do it:
xlabel('A*R\^(2/3) (m\^(8/3))')
Hamdullah Livaoglu
Hamdullah Livaoglu el 8 de Feb. de 2017
it doesnt' work in num2str?! like; text(double(tx),double(ty),['Q=',cfe1,'*x^',{cfe2}],'FontSize',12)
SHUBHAM CHANDRAKANT
SHUBHAM CHANDRAKANT el 21 de Nov. de 2023
my laptop does not have symbol (^) then how should i use it ?
Walter Roberson
Walter Roberson el 21 de Nov. de 2023
Could you post a picture of what your keyboard looks like? What is the typical region that uses that kind of keyboard?
SHUBHAM CHANDRAKANT
SHUBHAM CHANDRAKANT el 22 de Nov. de 2023
Silly me,after looking at every key properly i found (^), it was on the upper number row of keyboard.
BTW, Thank you for your response.

Iniciar sesión para comentar.

Más respuestas (3)

G A
G A el 7 de Dic. de 2013
xlabel('A*R^{2/3}m^{8/3}')

5 comentarios

Marijn
Marijn el 7 de Dic. de 2013
Thanks!
Azzi Abdelmalek
Azzi Abdelmalek el 8 de Dic. de 2013
This is not working
G A
G A el 8 de Dic. de 2013
Editada: G A el 8 de Dic. de 2013
In my system (R2013b win64) this is working - I checked before answering. This is for: "...or by placing the entire term in superscript"
Mohamed Alhamri
Mohamed Alhamri el 30 de Oct. de 2019
it works fine in R2016a win64
Rashid Shams
Rashid Shams el 23 de Jun. de 2021
It works fine in R2020a X64 too. thanks

Iniciar sesión para comentar.

IEESHAN SHARMA
IEESHAN SHARMA el 19 de Nov. de 2017

2 votos

Use title('Mean squared error xrec(t)-x(t)^{2}'). Make sure you use curly braces.

Preguntada:

el 7 de Dic. de 2013

Comentada:

el 22 de Nov. de 2023

Community Treasure Hunt

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

Start Hunting!

Translated by