📄 spectrumexpogui.m
字号:
spectrumexpofn 'update';% --- Executes during object creation, after setting all properties.function durationtext_CreateFcn(hObject, eventdata, handles)if ispc set(hObject,'BackgroundColor','white');else set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));endfunction durationtext_Callback(hObject, eventdata, handles) duration = str2double(get(hObject,'String')); if duration <= 0 duration = 0.01; set(handles.durationtext,'String',num2str(duration)); end set(handles.durationslider,'Value',duration); spectrumexpofn 'update';% --- Executes during object creation, after setting all properties.function durationslider_CreateFcn(hObject, eventdata, handles)usewhitebg = 1;if usewhitebg set(hObject,'BackgroundColor',[.9 .9 .9]);else set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));end% --- Executes on slider movement.function durationslider_Callback(hObject, eventdata, handles) duration = num2str(get(hObject,'Value')); set(handles.durationtext,'String',duration); spectrumexpofn 'update';% --- Executes on button press in gridbox.function gridbox_Callback(hObject, eventdata, handles) spectrumexpofn 'update';% --- Executes on button press in plot1box.function plot1box_Callback(hObject, eventdata, handles) spectrumexpofn 'update';% --- Executes on button press in plot2box.function plot2box_Callback(hObject, eventdata, handles) spectrumexpofn 'update';% --- Executes on button press in spectrumbutton.function spectrumbutton_Callback(hObject, eventdata, handles) spectrumexpofn 'spectrum';% --- Executes on button press in interpbox.function interpbox_Callback(hObject, eventdata, handles) spectrumexpofn 'update';% --- Executes on button press in samplebox.function samplebox_Callback(hObject, eventdata, handles) spectrumexpofn 'update';% --- Executes when user attempts to close spectrumexpogui_fig.function spectrumexpogui_fig_CloseRequestFcn(hObject, eventdata, handles)% hObject handle to spectrumexpogui_fig (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)% Hint: delete(hObject) closes the figuredelete(hObject);% --------------------------------------------------------------------function Untitled_1_Callback(hObject, eventdata, handles)% hObject handle to Untitled_1 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)% --------------------------------------------------------------------function fourier_Callback(hObject, eventdata, handles)% hObject handle to fourier (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) spectrumexpofn 'fourier';% --------------------------------------------------------------------function sonogram_Callback(hObject, eventdata, handles)% hObject handle to Untitled_3 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) spectrumexpofn 'sonogram';% --------------------------------------------------------------------function alias_Callback(hObject, eventdata, handles)% hObject handle to Untitled_2 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) spectrumexpofn 'alias';% --------------------------------------------------------------------function help_Callback(hObject, eventdata, handles)% hObject handle to help (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) spectrumexpofn 'help';% --- Creates and returns a handle to the GUI figure. function h1 = spectrumexpogui_LayoutFcn(policy)% policy - create a new figure or use a singleton. 'new' or 'reuse'.persistent hsingleton;if strcmpi(policy, 'reuse') & ishandle(hsingleton) h1 = hsingleton; return;endh1 = figure(...'Units','characters',...'Color',[0.701960784313725 0.701960784313725 0.701960784313725],...'Colormap',[0 0 0.5625;0 0 0.625;0 0 0.6875;0 0 0.75;0 0 0.8125;0 0 0.875;0 0 0.9375;0 0 1;0 0.0625 1;0 0.125 1;0 0.1875 1;0 0.25 1;0 0.3125 1;0 0.375 1;0 0.4375 1;0 0.5 1;0 0.5625 1;0 0.625 1;0 0.6875 1;0 0.75 1;0 0.8125 1;0 0.875 1;0 0.9375 1;0 1 1;0.0625 1 1;0.125 1 0.9375;0.1875 1 0.875;0.25 1 0.8125;0.3125 1 0.75;0.375 1 0.6875;0.4375 1 0.625;0.5 1 0.5625;0.5625 1 0.5;0.625 1 0.4375;0.6875 1 0.375;0.75 1 0.3125;0.8125 1 0.25;0.875 1 0.1875;0.9375 1 0.125;1 1 0.0625;1 1 0;1 0.9375 0;1 0.875 0;1 0.8125 0;1 0.75 0;1 0.6875 0;1 0.625 0;1 0.5625 0;1 0.5 0;1 0.4375 0;1 0.375 0;1 0.3125 0;1 0.25 0;1 0.1875 0;1 0.125 0;1 0.0625 0;1 0 0;0.9375 0 0;0.875 0 0;0.8125 0 0;0.75 0 0;0.6875 0 0;0.625 0 0;0.5625 0 0],...'IntegerHandle','off',...'InvertHardcopy',get(0,'defaultfigureInvertHardcopy'),...'KeyPressFcn','update_Callback(hObject, eventdata, handles)',...'MenuBar','none',...'Name','spectrumexpo',...'NumberTitle','off',...'PaperPosition',get(0,'defaultfigurePaperPosition'),...'Position',[128.6 -8.85897435897435 113.833333333333 63.1666666666667],...'Renderer',get(0,'defaultfigureRenderer'),...'RendererMode','manual',...'HandleVisibility','callback',...'Tag','spectrumexpo_fig',...'UserData',[]);setappdata(h1, 'GUIDEOptions',struct(...'active_h', [], ...'taginfo', struct(...'figure', 2, ...'axes', 7, ...'pushbutton', 5, ...'popupmenu', 3, ...'edit', 14, ...'text', 17, ...'slider', 13, ...'frame', 4, ...'togglebutton', 2, ...'checkbox', 7), ...'override', 1, ...'release', 13, ...'resize', 'simple', ...'accessibility', 'callback', ...'mfile', 1, ...'callbacks', 1, ...'singleton', 1, ...'syscolorfig', 1, ...'lastSavedFile', '/Users/bobsturm/gibson/SSUM/spectrum/spectrum/spectrumexpo.m', ...'blocking', 0));h2 = axes(...'Parent',h1,...'Units','characters',...'ALim',get(0,'defaultaxesALim'),...'ALimMode','manual',...'CameraPosition',[0.5 0.5 9.16025403784439],...'CameraPositionMode','manual',...'CameraTarget',[0.5 0.5 0.5],...'CameraTargetMode','manual',...'CameraUpVector',[0 1 0],...'CameraUpVectorMode','manual',...'CameraViewAngle',6.60861036031192,...'CameraViewAngleMode','manual',...'CLim',get(0,'defaultaxesCLim'),...'CLimMode','manual',...'Color',get(0,'defaultaxesColor'),...'ColorOrder',get(0,'defaultaxesColorOrder'),...'DataAspectRatio',get(0,'defaultaxesDataAspectRatio'),...'DataAspectRatioMode','manual',...'PlotBoxAspectRatio',get(0,'defaultaxesPlotBoxAspectRatio'),...'PlotBoxAspectRatioMode','manual',...'Position',[10.1666666666667 41.75 100 10],...'TickDir',get(0,'defaultaxesTickDir'),...'TickDirMode','manual',...'XColor',get(0,'defaultaxesXColor'),...'XLim',get(0,'defaultaxesXLim'),...'XLimMode','manual',...'XTick',[0 0.2 0.4 0.6 0.8 1],...'XTickLabel',{ '0 '; '0.2'; '0.4'; '0.6'; '0.8'; '1 ' },...'XTickLabelMode','manual',...'XTickMode','manual',...'YColor',get(0,'defaultaxesYColor'),...'YLim',get(0,'defaultaxesYLim'),...'YLimMode','manual',...'YTick',[0 0.2 0.4 0.6 0.8 1],...'YTickLabel',{ '0 '; '0.2'; '0.4'; '0.6'; '0.8'; '1 ' },...'YTickLabelMode','manual',...'YTickMode','manual',...'ZColor',get(0,'defaultaxesZColor'),...'ZLim',get(0,'defaultaxesZLim'),...'ZLimMode','manual',...'ZTick',[0 0.5 1],...'ZTickLabel','',...'ZTickLabelMode','manual',...'ZTickMode','manual',...'Tag','sinsum',...'UserData',[]);h3 = get(h2,'title');set(h3,...'Parent',h2,...'Color',[0 0 0],...'HorizontalAlignment','center',...'Position',[0.496598639455782 1.04421768707483 1.00005459937205],...'VerticalAlignment','bottom',...'HandleVisibility','off');h4 = get(h2,'xlabel');set(h4,...'Parent',h2,...'Color',[0 0 0],...'HorizontalAlignment','center',...'Position',[0.496598639455782 -0.153061224489796 1.00005459937205],...'VerticalAlignment','cap',...'HandleVisibility','off');h5 = get(h2,'ylabel');set(h5,...'Parent',h2,...'Color',[0 0 0],...'HorizontalAlignment','center',...'Position',[-0.163265306122449 0.493197278911564 1.00005459937205],...'Rotation',90,...'VerticalAlignment','bottom',...'HandleVisibility','off');h6 = get(h2,'zlabel');set(h6,...'Parent',h2,...'Color',[0 0 0],...'HorizontalAlignment','right',...'Position',[-1.48979591836735 2.14625850340136 1.00005459937205],...'HandleVisibility','off',...'Visible','off');h7 = uicontrol(...'Parent',h1,...'Units','characters',...'BackgroundColor',[0.597913499705588 0.713785514372254 1],...'CData',[],...'ListboxTop',0,...'Position',[58.1666666666667 7 53.5 9.25],...'String',{ '' },...'Style','frame',...'Tag','frame2',...'UserData',[]);h8 = uicontrol(...'Parent',h1,...'Units','characters',...'BackgroundColor',[0.597913499705588 0.713785514372254 1],...'CData',[],...'ListboxTop',0,...'Position',[2.16666666666667 3.75 53.5 12.5],...'String',{ '' },...'Style','frame',...'Tag','frame1',...'UserData',[]);h9 = uicontrol(...'Parent',h1,...'Units','characters',...'Callback','spectrumexpogui(''freq1_Callback'',gcbo,[],guidata(gcbo))',...'ListboxTop',0,...'Position',[41.6666666666667 14.0833333333333 12.1666666666667 1.5],...'String','440',...'Style','edit',...'Value',440,...'ButtonDownFcn','spectrumexpogui(''freq1_ButtonDownFcn'',gcbo,[],guidata(gcbo))',...'CreateFcn','spectrumexpogui(''freq1_CreateFcn'',gcbo,[],guidata(gcbo))',...'Tag','freq1');h10 = uicontrol(...'Parent',h1,...'Units','characters',...'Callback','spectrumexpogui(''amp1_Callback'',gcbo,[],guidata(gcbo))',...'ListboxTop',0,...'Position',[41.6666666666667 11.3333333333333 12.1666666666667 1.5],...'String','0.5',...'Style','edit',...'CreateFcn','spectrumexpogui(''amp1_CreateFcn'',gcbo,[],guidata(gcbo))',...'Tag','amp1');h11 = uicontrol(...'Parent',h1,...'Units','characters',...'Callback','spectrumexpogui(''phase1_Callback'',gcbo,[],guidata(gcbo))',...'ListboxTop',0,...'Position',[41.6666666666667 8.66666666666667 12.1666666666667 1.5],...'String','0.0',...'Style','edit',...'CreateFcn','spectrumexpogui(''phase1_CreateFcn'',gcbo,[],guidata(gcbo))',...'Tag','phase1');h12 = uicontrol(...'Parent',h1,...'Units','characters',...'BackgroundColor',[0.597913499705588 0.713785514372254 1],...'CData',[],...'HorizontalAlignment','left',...'ListboxTop',0,...'Position',[4 13.8333333333333 16.3333333333333 1.33333333333333],...'String','Frequency (Hz)',...'Style','text',...'Tag','text1',...'UserData',[]);h13 = uicontrol(...'Parent',h1,...'Units','characters',...'BackgroundColor',[0.597913499705588 0.713785514372254 1],...'CData',[],...'HorizontalAlignment','left',...'ListboxTop',0,...'Position',[4 10.8333333333333 11.5 1.5],...'String','Amplitude',...'Style','text',...'Tag','text3',...'UserData',[]);h14 = uicontrol(...'Parent',h1,...'Units','characters',...'BackgroundColor',[0.597913499705588 0.713785514372254 1],...'CData',[],...'HorizontalAlignment','left',...'ListboxTop',0,...'Position',[60.1666666666667 11.0833333333333 13.6666666666667 1.33333333333333],...'String','Amplitude',...'Style','text',...'Tag','text4',...'UserData',[]);h15 = uicontrol(...'Parent',h1,...'Units','characters',...'BackgroundColor',[0.597913499705588 0.713785514372254 1],...'CData',[],...'HorizontalAlignment','left',...'ListboxTop',0,...'Position',[4 8.33333333333333 13.5 1.25],...'String','Phase (deg)',...'Style','text',...'Tag','text5',...'UserData',[]);h16 = uicontrol(...'Parent',h1,...'Units','characters',...'BackgroundColor',[0.597913499705588 0.713785514372254 1],...'CData',[],...'HorizontalAlignment','left',...'ListboxTop',0,...'Position',[60.1666666666667 8.08333333333333 14 1.41666666666667],...'String','Phase (deg)',...'Style','text',...'Tag','text6',...'UserData',[]);h17 = uicontrol(...'Parent',h1,...'Units','characters',...'BackgroundColor',[0.597913499705588 0.713785514372254 1],...'CData',[],...'HorizontalAlignment','left',...'ListboxTop',0,...'Position',[60.1666666666667 13.3333333333333 18.3333333333333 1.83333333333333],...'String','Frequency (Hz)',...'Style','text',...'Tag','text7',...'UserData',[]);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -