필터 지우기
필터 지우기

Supressing messages of the type "(command) will be removed in a future release."

조회 수: 6 (최근 30일)
AwedBy Matlab
AwedBy Matlab 2014년 6월 18일
댓글: José-Luis 2014년 6월 19일
Hi all
I need to play some WAV files, and for some reason audioplayer isn't playing them, whereas wavplay is. However, on every call of the wavplay function, I get the warning: "WAVPLAY will be removed in a future release. Use AUDIOPLAYER instead. " displayed in the command window, which is disruptive to the user.
Is there any way to make these warnings stop appearing every time I call wavplay?
Thanks!

답변 (2개)

José-Luis
José-Luis 2014년 6월 18일
  댓글 수: 4
AwedBy Matlab
AwedBy Matlab 2014년 6월 19일
Ah, sorry about that, hadn't noticed that the word 'yes' was a hyperlink! Thanks for your help.
José-Luis
José-Luis 2014년 6월 19일
Please accept an answer if it solved your problem.

댓글을 달려면 로그인하십시오.


Image Analyst
Image Analyst 2014년 6월 19일
Please see my function below (and also attached) that turns that off, plus others that are common:
% 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 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 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 wavread() being deprecated:
% "Warning: WAVREAD will be removed in a future release. Use AUDIOREAD instead."
warning('off', 'MATLAB:audiovideo:wavread:functionToBeRemoved');
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

카테고리

Help CenterFile Exchange에서 Audio and Video Data에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by