![Screen Shot 2019-01-07 at 1.59.19 PM.png](https://www.mathworks.com/matlabcentral/answers/uploaded_files/200288/Screen%20Shot%202019-01-07%20at%201.59.19%20PM.png)
How to write 2 didgits after decimal in text figure like given below
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Megha
am 7 Jan. 2019
Kommentiert: madhan ravi
am 7 Jan. 2019
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
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/200286/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/200287/image.png)
Can anyone please help!
0 Kommentare
Akzeptierte Antwort
madhan ravi
am 7 Jan. 2019
Bearbeitet: madhan ravi
am 7 Jan. 2019
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](https://www.mathworks.com/matlabcentral/answers/uploaded_files/200288/Screen%20Shot%202019-01-07%20at%201.59.19%20PM.png)
2 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Characters and Strings finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!