⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 nnsound.m

📁 《神经网络设计》英文版的配套源代码
💻 M
字号:
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.
% Copyright 1994-2002 PWS Publishing Company and The MathWorks, Inc.
% $Revision: 1.8 $

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

global NNDSNDFLAG
if (isempty(NNDSNDFLAG) & isunix) 
   NNDSNDFLAG='off';
end;
if nargin == 1
  fs = 8192;
end
drawnow;pause(0);
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,'SOL2') | strcmp(c,'SGI') | ...
         strcmp(c,'HPUX') | strcmp(c,'HP700') | ...
         strcmp(c(1:3),'MAC') | strcmp(c,'NEXT') | strcmp(c,'SGI') | ...
         strcmp(c(1:2),'PC')
      success=1;
      tic;
      try, pause(0),sound(y,fs), catch, pause(0);success=0; end
      if success
         wait=(length(y)/fs)+.1;
         while (toc<wait | toc>10) end;
      end;
   end         
drawnow; pause(0);   
end

⌨️ 快捷键说明

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