How to adapt the number format for text in a graph

R
Robert · Aug 26, 2020 · 2K views
Question
I've added some text to a graph which consists of text and a value. In this case: "99% Lower Confidence Limit =" and then the value. Right now, the value is shown as 2738435 and I would like to make it 2.7 million or at least 2,738,435. How should I do that? The code that I use is: text(1,1,['99% Lower Confidence Limit =',num2str(value)]);
Expert Answer
Profile picture of Neeta Dsouza
Neeta Dsouza PhD Expert
Answered Aug 24, 2026
or your could use:
text(1,1,sprintf('99%% Lower Confidence Limit =%3.2f Million',value/1e6));
100% Run Guarantee 3-Hour Fast-Track Delivery

Need a Custom Version or Complete Simulation for This Problem?

Our 500+ PhD engineers build, debug, and optimize working MATLAB scripts and Simulink (.slx) models tailored to your exact assignment rubrics with zero plagiarism.

Tested on MATLAB R2024b / R2026a
Turnitin 0% Plagiarism Report
Free 7-Day Revisions Guarantee
Have a different question? Ask here

Get a Free Consultation or a Sample Assignment Review!