How to save image with floating number name?

1 view (last 30 days)
Ayushi Joshi
Ayushi Joshi on 23 Jun 2021
Answered: DGM on 23 Jun 2021
Hi,
I am trying to write a script and needed help with come of the code part.
I want to save the image text in png format with a name in floating points.

Answers (1)

DGM
DGM on 23 Jun 2021
You mean something like this?
mypict = rand(100);
mn = mean(mypict(:));
filename = sprintf('the_mean_pixel_value_is_%.4e.png',mn);
filename = 'the_mean_pixel_value_is_5.0081e-01.png'
imwrite(mypict,filename);

Categories

Find more on Image Processing Toolbox in Help Center and File Exchange

Products


Release

R2021a

Community Treasure Hunt

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

Start Hunting!