remove decimals from title when using sprintf
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Joel
el 11 de Abr. de 2023
Respondida: Les Beckham
el 11 de Abr. de 2023
I have this to my figure
Q=2021; %year
plot(x,y)
title(sprintf('text %f',Q))
But the title is
text 2021.00000000
How do I remove the decimals?
0 comentarios
Respuesta aceptada
Les Beckham
el 11 de Abr. de 2023
Q=2021; %year
x = 0:10;
y = x.^2;
plot(x,y)
grid on
title(sprintf('text %d',Q)) % <<< replace %f with %d
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Title en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!