Sometimes you need a fresh figure, but you want to control/save the figure number. This script retrieves the list of opened figure windows and finds n_requested unused figure numbers.
This code is written to be portable over OS (Windows/Mac/Unix) and platform (Matlab/Octave). It should work on just about any version.
Cite As
Rik (2024). getfignum(n_requested) (https://www.mathworks.com/matlabcentral/fileexchange/61505-getfignum-n_requested), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Created with
R2016b
Compatible with any release
Platform Compatibility
Windows macOS LinuxCategories
Find more on Octave in Help Center and MATLAB Answers
Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
Version | Published | Release Notes | |
---|---|---|---|
1.0.0.0 |