2 digits after the dot
이전 댓글 표시
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 :)
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Numeric Types에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!