Matlab电话面板.docx

上传人:b****6 文档编号:7589958 上传时间:2023-01-25 格式:DOCX 页数:16 大小:17.22KB
下载 相关 举报
Matlab电话面板.docx_第1页
第1页 / 共16页
Matlab电话面板.docx_第2页
第2页 / 共16页
Matlab电话面板.docx_第3页
第3页 / 共16页
Matlab电话面板.docx_第4页
第4页 / 共16页
Matlab电话面板.docx_第5页
第5页 / 共16页
点击查看更多>>
下载资源
资源描述

Matlab电话面板.docx

《Matlab电话面板.docx》由会员分享,可在线阅读,更多相关《Matlab电话面板.docx(16页珍藏版)》请在冰豆网上搜索。

Matlab电话面板.docx

Matlab电话面板

WKM-fileforwk.fig

%WK,byitself,createsanewWKorraisestheexisting

%singleton*.

%

%H=WKreturnsthehandletoanewWKorthehandleto

%theexistingsingleton*.

%

%WK('Property','Value',...)createsanewWKusingthe

%givenpropertyvaluepairs.Unrecognizedpropertiesarepassedvia

%varargintowk_OpeningFcn.Thiscallingsyntaxproducesa

%warningwhenthereisanexistingsingleton*.

%

%WK('CALLBACK')andWK('CALLBACK',hObject,...)callthe

%localfunctionnamedCALLBACKinWK.Mwiththegiveninput

%arguments.

%

%*SeeGUIOptionsonGUIDE'sToolsmenu.Choose"GUIallowsonlyone

%instancetorun(singleton)".

%

%Seealso:

GUIDE,GUIDATA,GUIHANDLES

%Edittheabovetexttomodifytheresponsetohelpwk

%LastModifiedbyGUIDEv2.521-Jan-201119:

47:

23

%Begininitializationcode-DONOTEDIT

gui_Singleton=1;

gui_State=struct('gui_Name',mfilename,...

'gui_Singleton',gui_Singleton,...

'gui_OpeningFcn',@wk_OpeningFcn,...

'gui_OutputFcn',@wk_OutputFcn,...

'gui_LayoutFcn',[],...

'gui_Callback',[]);

ifnargin&&ischar(varargin{1})

gui_State.gui_Callback=str2func(varargin{1});

end

ifnargout

[varargout{1:

nargout}]=gui_mainfcn(gui_State,varargin{:

});

else

gui_mainfcn(gui_State,varargin{:

});

end

%Endinitializationcode-DONOTEDIT

%---Executesjustbeforewkismadevisible.

functionwk_OpeningFcn(hObject,eventdata,handles,varargin)

%Thisfunctionhasnooutputargs,seeOutputFcn.

%hObjecthandletofigure

%eventdatareserved-tobedefinedinafutureversionofMATLAB

%handlesstructurewithhandlesanduserdata(seeGUIDATA)

%vararginunrecognizedPropertyName/PropertyValuepairsfromthe

%commandline(seeVARARGIN)

%Choosedefaultcommandlineoutputforwk

handles.output=hObject;

%Updatehandlesstructure

guidata(hObject,handles);

%UIWAITmakeswkwaitforuserresponse(seeUIRESUME)

%uiwait(handles.figure1);

%---Outputsfromthisfunctionarereturnedtothecommandline.

functionvarargout=wk_OutputFcn(hObject,eventdata,handles)

%varargoutcellarrayforreturningoutputargs(seeVARARGOUT);

%hObjecthandletofigure

%eventdatareserved-tobedefinedinafutureversionofMATLAB

%handlesstructurewithhandlesanduserdata(seeGUIDATA)

%Getdefaultcommandlineoutputfromhandlesstructure

varargout{1}=handles.output;

%---Executesonbuttonpressinpushbutton80.

functionpushbutton80_Callback(hObject,eventdata,handles)

%hObjecthandletopushbutton80(seeGCBO)

%eventdatareserved-tobedefinedinafutureversionofMATLAB

%handlesstructurewithhandlesanduserdata(seeGUIDATA)

globalNUM

wavplay(NUM,8192);

L=length(NUM);

n=L/1100;

number='';

fori=1:

n

j=(i-1)*1100+1;

d=NUM(j:

j+999);%截取出每个数字对应的1000个采样点

f=fft(d,2048);%以N=2048作FFT变换

a=abs(f);

p=a.*a;%计算功率谱

num

(1)=find(p(1:

250)==max(p(1:

250)));%找行频

num

(2)=300+find(p(300:

380)==max(p(300:

380)));%找列频

if(num

(1)<180)row=1;%确定行数

elseif(num

(1)<200)row=2;

elseif(num

(1)<220)row=3;

elserow=4;

end

if(num

(2)<320)column=1;%确定列数

elseif(num

(2)<340)column=2;

elsecolumn=3;

end

z=[row,column];%确定数字

ifz==[4,2]tel=0;

elseifz==[1,1]tel=1;

elseifz==[1,2]tel=2;

elseifz==[1,3]tel=3;

elseifz==[2,1]tel=4;

elseifz==[2,2]tel=5;

elseifz==[2,3]tel=6;

elseifz==[3,1]tel=7;

elseifz==[3,2]tel=8;

elseifz==[3,3]tel=9;

end

c=strcat(number,int2str(tel));

number=c;

i=i+1;

end

set(handles.edit8,'string',number);

%---Executesonbuttonpressinpushbutton81.

functionpushbutton81_Callback(hObject,eventdata,handles)

%hObjecthandletopushbutton81(seeGCBO)

%eventdatareserved-tobedefinedinafutureversionofMATLAB

%handlesstructurewithhandlesanduserdata(seeGUIDATA)

n=[1:

1000];

num=get(handles.edit7,'string');

len=length(num);

n11='';%去掉末尾号码在面板上的显示

d11=sin(0.7217*n)+sin(0.9273*n);

set(handles.edit7,'string',n11);

globalNUM

L=length(NUM);

NUM=NUM(1:

L-1100);%删除末尾号码在拨号音信号中的存储

wavplay(d11,8192);

functionedit7_Callback(hObject,eventdata,handles)

%hObjecthandletoedit7(seeGCBO)

%eventdatareserved-tobedefinedinafutureversionofMATLAB

%handlesstructurewithhandlesanduserdata(seeGUIDATA)

%Hints:

get(hObject,'String')returnscontentsofedit7astext

%str2double(get(hObject,'String'))returnscontentsofedit7asadouble

%---Executesduringobjectcreation,aftersettingallproperties.

functionedit7_CreateFcn(hObject,eventdata,handles)

%hObjecthandletoedit7(seeGCBO)

%eventdatareserved-tobedefinedinafutureversionofMATLAB

%handlesempty-handlesnotcreateduntilafterallCreateFcnscalled

%Hint:

editcontrolsusuallyhaveawhitebackgroundonWindows.

%SeeISPCandCOMPUTER.

ifispc&&isequal(get(hObject,'BackgroundColor'),get(0,'defaultUicontrolBackgroundColor'))

set(hObject,'BackgroundColor','white');

end

%---Executesonbuttonpressinpushbutton82.

functionpushbutton82_Callback(hObject,eventdata,handles)

%hObjecthandletopushbutton82(seeGCBO)

%eventdatareserved-tobedefinedinafutureversionofMATLAB

%handlesstructurewithhandlesanduserdata(seeGUIDATA)

%---Executesonbuttonpressinpushbutton84.

functionpushbutton84_Callback(hObject,eventdata,handles)

%hObjecthandletopushbutton84(seeGCBO)

%eventdatareserved-tobedefinedinafutureversionofMATLAB

%handlesstructurewithhandlesanduserdata(seeGUIDATA)

functionedit8_Callback(hObject,eventdata,handles)

%hObjecthandletoedit8(seeGCBO)

%eventdatareserved-tobedefinedinafutureversionofMATLAB

%handlesstructurewithhandlesanduserdata(seeGUIDATA)

%Hints:

get(hObject,'String')returnscontentsofedit8astext

%str2double(get(hObject,'String'))returnscontentsofedit8asadouble

%---Executesduringobjectcreation,aftersettingallproperties.

functionedit8_CreateFcn(hObject,eventdata,handles)

%hObjecthandletoedit8(seeGCBO)

%eventdatareserved-tobedefinedinafutureversionofMATLAB

%handlesempty-handlesnotcreateduntilafterallCreateFcnscalled

%Hint:

editcontrolsusuallyhaveawhitebackgroundonWindows.

%SeeISPCandCOMPUTER.

ifispc&&isequal(get(hObject,'BackgroundColor'),get(0,'defaultUicontrolBackgroundColor'))

set(hObject,'BackgroundColor','white');

end

functionedit9_Callback(hObject,eventdata,handles)

%hObjecthandletoedit9(seeGCBO)

%eventdatareserved-tobedefinedinafutureversionofMATLAB

%handlesstructurewithhandlesanduserdata(seeGUIDATA)

%Hints:

get(hObject,'String')returnscontentsofedit9astext

%str2double(get(hObject,'String'))returnscontentsofedit9asadouble

%---Executesduringobjectcreation,aftersettingallproperties.

functionedit9_CreateFcn(hObject,eventdata,handles)

%hObjecthandletoedit9(seeGCBO)

%eventdatareserved-tobedefinedinafutureversionofMATLAB

%handlesempty-handlesnotcreateduntilafterallCreateFcnscalled

%Hint:

editcontrolsusuallyhaveawhitebackgroundonWindows.

%SeeISPCandCOMPUTER.

ifispc&&isequal(get(hObject,'BackgroundColor'),get(0,'defaultUicontrolBackgroundColor'))

set(hObject,'BackgroundColor','white');

end

%---Executesonbuttonpressinpushbutton57.

functionpushbutton57_Callback(hObject,eventdata,handles)

%hObjecthandletopushbutton57(seeGCBO)

%eventdatareserved-tobedefinedinafutureversionofMATLAB

%handlesstructurewithhandlesanduserdata(seeGUIDATA)

n=[1:

1000];%每个数字1000个采样点表示

d0=sin(0.5346*n)+sin(0.9894*n);%对应行频列频叠加

n0=strcat(get(handles.edit7,'string'),'1');%获取数字号码

set(handles.edit7,'string',n0);%显示号码

space=zeros(1,100);%100个0模拟静音信号

globalNUM

phone=[NUM,d0];

NUM=[phone,space];%存储连续的拨号音信号

wavplay(d0,8192);%产生拨号音

%---Executesonbuttonpressinpushbutton69.

functionpushbutton69_Callback(hObject,eventdata,handles)

%hObjecthandletopushbutton69(seeGCBO)

%eventdatareserved-tobedefinedinafutureversionofMATLAB

%handlesstructurewithhandlesanduserdata(seeGUIDATA)

n=[1:

1000];%每个数字1000个采样点表示

d0=sin(0.5346*n)+sin(1.0247*n);%对应行频列频叠加

n0=strcat(get(handles.edit7,'string'),'2');%获取数字号码

set(handles.edit7,'string',n0);%显示号码

space=zeros(1,100);%100个0模拟静音信号

globalNUM

phone=[NUM,d0];

NUM=[phone,space];%存储连续的拨号音信号

wavplay(d0,8192);%产生拨号音

%---Executesonbuttonpressinpushbutton70.

functionvarargout=pushbutton0_Callback(h,eventdata,handles,varargin)

n=[1:

1000];%每个数字1000个采样点表示

d0=sin(0.7217*n)+sin(1.0247*n);%对应行频列频叠加

n0=strcat(get(handles.edit1,'string'),'0');%获取数字号码

set(handles.edit1,'string',n0);%显示号码

space=zeros(1,100);%100个0模拟静音信号

globalNUM

phone=[NUM,d0];

NUM=[phone,space];%存储连续的拨号音信号

wavplay(d0,8192);%产生拨号音

%hObjecthandletopushbutton70(seeGCBO)

%eventdatareserved-tobedefinedinafutureversionofMATLAB

%handlesstructurewithhandlesanduserdata(seeGUIDATA)

%---Executesonbuttonpressinpushbutton71.

functionpushbutton71_Callback(hObject,eventdata,handles)

%hObjecthandletopushbutton71(seeGCBO)

%eventdatareserved-tobedefinedinafutureversionofMATLAB

%handlesstructurewithhandlesanduserdata(seeGUIDATA)

n=[1:

1000];

num=get(handles.edit7,'string');

len=length(num);

n11=strrep(num,num,num(1:

len-1));%去掉末尾号码在面板上的显示

d11=sin(0.7217*n)+sin(0.9273*n);

set(handles.edit7,'string',n11);

globalNUM

L=length(NUM);

NUM=NUM(1:

L-1100);%删除末尾号码在拨号音信号中的存储

wavplay(d11,8192);

%---Executesonbutton

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 高等教育 > 工学

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1