📄 soundbutton.m
字号:
function SoundButton(n,h)
% Added in version 1.1
% Updates the value of soundmode and plays the signal vector y as a sound through the computer speakers
% Tom O'Haver, May 2007
global x
global y
global samplingtime
global samplerate
global f1
global f2
global signaltype
global signalstring
global soundmode
soundmode=round(n);
if soundmode==1,
xlabel([ 'n= ' num2str(length(y)) ' Time = ' num2str(0.1*round(10*samplingtime)) ' Rate = ' num2str(round(samplerate)) ' F1 = ' num2str(0.1*round(10*f1)) ' F2= ' num2str(0.1*round(10*f2)) ' Sound ON'])
else
xlabel([ 'n= ' num2str(length(y)) ' Time = ' num2str(0.1*round(10*samplingtime)) ' Rate = ' num2str(round(samplerate)) ' F1 = ' num2str(0.1*round(10*f1)) ' F2= ' num2str(0.1*round(10*f2)) ' Sound OFF'])
end
wavplay(y./2,samplerate)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -