How to write 2 didgits after decimal in text figure like given below

조회 수: 1 (최근 30일)
Megha
Megha 2019년 1월 7일
댓글: madhan ravi 2019년 1월 7일
how to print on a figure the text like
here p1 = 0.234567546485, k1 = 0.045677869
text(800,0.3,['\Delta = ' num2str(fprintf('%.2f',(k1*100))),newline,'S = ' num2str(fprintf('%.2f',(p1*100)))],...
'FontWeight','bold','FontSize',12);
I want o/p like
and in the next line below
Can anyone please help!

채택된 답변

madhan ravi
madhan ravi 2019년 1월 7일
편집: madhan ravi 2019년 1월 7일
a=['\Delta = ',sprintf('%.2f\n',(k1*100)),...
'S = ',sprintf('%.2f',(p1*100))];
text(800,0.3,a,...
'FontWeight','bold','FontSize',12);
Screen Shot 2019-01-07 at 1.59.19 PM.png

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Data Type Conversion에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by