Plot title sprintf format pi
Show older comments
How can I display on a plot's Title the input value pi with Greek character "π" or in English "pi". For example: prompt = 'What is the original value? '; x = input(prompt) I insert the value pi/2 So i want the plot title to be like: Output=π/2 I used the following code but it keeps giving me the value 0.707 instead of the π/2 or pi/2 i want.
str = sprintf('Output x=%d',x);
title(str);
Accepted Answer
More Answers (0)
Categories
Find more on Labels and Annotations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!