Conversion operators error!

3 visualizaciones (últimos 30 días)
Lukas Netzer
Lukas Netzer el 6 de Mayo de 2021
Comentada: Image Analyst el 6 de Mayo de 2021
I'm trying to set my xTicklabels:
set(gca, 'xtick',1:8,'XTickLabels',compose('diffNA2l','diffNA2h','diffA2l','diffA2h','allNA2h','allNA2l','allA2l','allA2h'))
it is giving me
Error using compose (line 98)
Format must have enough conversion operators for the data arguments.
Why?

Respuesta aceptada

Scott MacKenzie
Scott MacKenzie el 6 de Mayo de 2021
You don't need compose because you aren't formatting numeric values into the labels. Just specifiy your labels in a cell array:
bar(1:8, rand(1,8));
labels = {'diffNA2l','diffNA2h','diffA2l','diffA2h','allNA2h','allNA2l','allA2l','allA2h'};
set(gca, 'xtick', 1:8, 'XTickLabels', labels);
  2 comentarios
Lukas Netzer
Lukas Netzer el 6 de Mayo de 2021
thanks a lot - still much to learn!
Image Analyst
Image Analyst el 6 de Mayo de 2021
Or you could use the separate functions made for dealing with tick marks (R2016b and later):
xticks()
xticklabels()

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Grid Lines, Tick Values, and Labels en Help Center y File Exchange.

Productos


Versión

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by