FIG2MFILE - Save a figure as an M-file (ver 2.0)

버전 1.0.0.0 (2.04 KB) 작성자: Michael Kleder
Saves a figure as an executable m-file.
다운로드 수: 3.9K
업데이트 날짜: 2005/10/31

라이선스 없음

FIG2MFILE - save a figure as an executable mfile

USAGE: fig2mfile(fig,'myfig')

fig = figure number of figure to be saved
'myfig' = desired mfile name

NOTES:

(1) Most plots and images can be saved. Most data types can now be handled, including multi-level and multi-dimensional structs and cell arrays. In tests, GUIs can be handled; however, saving a GUI figure window does cannot save its associated callback functions and cannot preserve the numerical value of handles (since they are regenerated at the each figure creation).
(2) To answer the inevitable question, this function will be needed by authors who don't want to include a separate saved figure file in a release of their software, but would rather include the figure generation in their code (e.g. for a compiled software release).
(3) Complex figures can take a few minutes to reduce to m-file format. Disk usage greatly increases from fig-file format as one might expect. (Incidentally, zip-file compression reduces the size to roughly comparable with fig-file size.)
(4) The generated mfile contains a single function ("drawfig") which can be moved into other code as needed.
(5) The created function returns a handle to the figure when it is executed.
(6) ver 1.0: initial writing, Michael Kleder, July 2005
(7) ver 2.0: accept new & multi-level datatypes, Michael Kleder, Oct 2005

EXAMPLE:

surf(peaks+peaks.^2)
title('Squared Peaks')
fig2mfile(gcf,'mypeaks')
close all
h=mypeaks

인용 양식

Michael Kleder (2024). FIG2MFILE - Save a figure as an M-file (ver 2.0) (https://www.mathworks.com/matlabcentral/fileexchange/8000-fig2mfile-save-a-figure-as-an-m-file-ver-2-0), MATLAB Central File Exchange. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R14SP1
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 MATLAB Report Generator에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!
버전 게시됨 릴리스 정보
1.0.0.0

Handles much more complicated figures including GUIs and figures containing multi-level and multi-dimensional structs and cell arrays.