warning message when save figure

7 visualizaciones (últimos 30 días)
Junghak
Junghak el 18 de Nov. de 2014
Respondida: Image Analyst el 18 de Nov. de 2014
Hi,
I got below warning message whenever I close and save my figure in guide. How can I remove this warning message?
Warning: Figure is saved in D:\agile\CODE\GUI\CAT_Reporter_A.fig. Loading this file recreates and displays the figure and its contents. Refer to save for more information. > In FigFile.write at 32 In hgsave at 95 In guidefunc>saveGuideFig at 2763 In guidefunc>layoutSave at 1498 In guidefunc at 118

Respuestas (1)

Image Analyst
Image Analyst el 18 de Nov. de 2014
See this function that turns off a bunch of harmless, benign warning messages. It has instructions for adding yours.
% http://www.mathworks.com/help/matlab/matlab_prog/suppress-warnings.html
function TurnOffWarnings
try
% To set the warning state, you must first know the message identifier for the one warning you want to enable.
% Query the last warning to acquire the identifier. For example:
% warnStruct = warning('query', 'last')
% messageID = warnStruct.identifier
% messageID =
% MATLAB:concatenation:integerInteraction
% Turn off this warning "Warning: Image is too big to fit on screen; displaying at 33% "
warning('off', 'Images:initSize:adjustingMag');
% Get rid of warning about directory already existing:
% "Warning: Directory already exists."
warning('off', 'MATLAB:MKDIR:DirectoryExists');
% Turn off note "Warning: Added specified worksheet." that appears in the command window.
warning('off', 'MATLAB:xlswrite:AddSheet');
% Get rid of warning about roipolyold being deprecated:
% "Warning: Function ROIPOLYOLD will be removed in the future. Use ROIPOLY instead"
warning('off', 'images:removing:function');
% Get rid of warning about wavread() being deprecated:
% "Warning: WAVREAD will be removed in a future release. Use AUDIOREAD instead."
warning('off', 'MATLAB:audiovideo:wavread:functionToBeRemoved');
% Get rid of warning about wavread() being deprecated:
% "Warning: figure JavaFrame property will be obsoleted in a future release. For more information see the JavaFrame resource on the MathWorks web site."
warning('off', 'MATLAB:HandleGraphics:ObsoletedProperty:JavaFrame');
catch ME
errorMessage = sprintf('Error in function %s() at line %d.\n\nError Message:\n%s', ...
ME.stack(1).name, ME.stack(1).line, ME.message);
fprintf(1, '%s\n', errorMessage);
WarnUser(errorMessage);
end
return; % from TurnOffWarnings

Categorías

Más información sobre Interactive Control and Callbacks en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by