2 digits after the dot
Afficher commentaires plus anciens
Hi
In the following example where do I put: ,'%0.2f'
x = [1 2 3];
vals = [2 3.3333333 6; 11 23 26];
b = bar(x,vals);
xtips1 = b(1).XEndPoints;
ytips1 = b(1).YEndPoints;
labels1 = string(b(1).YData);
text(xtips1,ytips1,labels1,'HorizontalAlignment','center','VerticalAlignment','bottom')
xtips2 = b(2).XEndPoints;
ytips2 = b(2).YEndPoints;
labels2 = string(b(2).YData);
text(xtips2,ytips2,labels2,'HorizontalAlignment','center','VerticalAlignment','bottom')
Same problem here:
x = 0:pi/100:2*pi;
y = sin(x);
plot(x,y)
my_num= 3.33333
text_information =['my num is : ' num2str((my_num))];
xlabel(text_information); xlabel(text_information,'interpreter','latex')
tnx :)
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Numeric Types dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!