nnsound.m

来自「关于神经网络方面的130个程序」· M 代码 · 共 43 行

M
43
字号
function nnsound(y,fs)
%NNSOUND Turn Neural Network Design sounds on and off.
%
%	NNSOUND OFF turns off demo sounds.
%	  Use this to avoid annoying co-workers and to speed up
%	  demos with lots of sound.
%
%	NNSOUND ON turns them back on.
%	  Use this when you to experience quadraphonic digitally
%	  enhanced audio entertainment and you don't care who
%	  knows it.
%
%	Regardless of the settings described above, sound is always
%	off for the Student Edition of MATLAB.

% First Version, 8-31-95.

%==================================================================

global NNDSNDFLAG

if nargin == 1
  fs = 8192;
end

if isstr(y)
  y = lower(y);
  if strcmp(y,'off')
    NNDSNDFLAG = 'off';
  elseif strcmp(y,'on')
    NNDSNDFLAG = 'on';
  end

elseif ~strcmp(NNDSNDFLAG,'off') & ~nnstuded
  c = computer;
  if strcmp(c,'SUN4') | strcmp(c,'HP700') | strcmp(c,'SOL2') | ...
     strcmp(c(1:3),'MAC') | strcmp(c,'NEXT') | strcmp(c,'SGI') | ...
     strcmp(c(1:2),'PC')

    sound(y,fs)
  end
end

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?