📄 ksstringexpogui.m
字号:
function varargout = ksstringexpogui(varargin)% KSSTRINGEXPOGUI M-file for ksstringexpogui.fig% KSSTRINGEXPOGUI, by itself, creates a new KSSTRINGEXPOGUI or raises the existing% singleton*.%% H = KSSTRINGEXPOGUI returns the handle to a new KSSTRINGEXPOGUI or the handle to% the existing singleton*.%% KSSTRINGEXPOGUI('CALLBACK',hObject,eventData,handles,...) calls the local% function named CALLBACK in KSSTRINGEXPOGUI.M with the given input arguments.%% KSSTRINGEXPOGUI('Property','Value',...) creates a new KSSTRINGEXPOGUI or raises the% existing singleton*. Starting from the left, property value pairs are% applied to the GUI before ksstringexpogui_OpeningFunction gets called. An% unrecognized property name or invalid value makes property application% stop. All inputs are passed to ksstringexpogui_OpeningFcn via varargin.%% *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one% instance to run (singleton)".%% See also: GUIDE, GUIDATA, GUIHANDLES% Edit the above text to modify the response to help ksstringexpogui% Last Modified by GUIDE v2.5 31-Mar-2005 09:44:05% Begin initialization code - DO NOT EDITgui_Singleton = 1;gui_State = struct('gui_Name', mfilename, ... 'gui_Singleton', gui_Singleton, ... 'gui_OpeningFcn', @ksstringexpogui_OpeningFcn, ... 'gui_OutputFcn', @ksstringexpogui_OutputFcn, ... 'gui_LayoutFcn', @ksstringexpogui_LayoutFcn, ... 'gui_Callback', []);if nargin & isstr(varargin{1}) gui_State.gui_Callback = str2func(varargin{1});endif nargout [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});else gui_mainfcn(gui_State, varargin{:});end% End initialization code - DO NOT EDIT% --- Executes just before ksstringexpogui is made visible.function ksstringexpogui_OpeningFcn(hObject, eventdata, handles, varargin)% This function has no output args, see OutputFcn.% hObject handle to figure% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)% varargin command line arguments to ksstringexpogui (see VARARGIN)% Choose default command line output for ksstringexpogui handles.output = hObject; guidata(hObject, handles); set(gcf,'UserData',handles); ksstringexpofn; if (nargin > 3) datastruct = varargin{1}; ksstringexpofn('readinput',datastruct); end% --- Outputs from this function are returned to the command line.function varargout = ksstringexpogui_OutputFcn(hObject, eventdata, handles) varargout{1} = handles.output;% --------------------------------------------------------------------function FileMenu_Callback(hObject, eventdata, handles)% --------------------------------------------------------------------function PrintMenuItem_Callback(hObject, eventdata, handles) ksstringexpofn 'print';% --------------------------------------------------------------------function CloseMenuItem_Callback(hObject, eventdata, handles) ksstringexpofn 'close';% --- Executes on button press in print.function print_Callback(hObject, eventdata, handles) ksstringexpofn 'print';% --------------------------------------------------------------------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% ----------9----------------------------------------------------------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) ksstringexpofn 'help';% --- Executes when ksstringexpogui_fig window is resized.function ksstringexpogui_fig_ResizeFcn(hObject, eventdata, handles)% hObject handle to ksstringexpogui_fig (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) ksstringexpofn 'resize';% --- Executes on button press in play.function play_Callback(hObject, eventdata, handles)% hObject handle to play (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) ksstringexpofn 'play';% --- Executes on selection change in excite_menu.function excite_menu_Callback(hObject, eventdata, handles)% hObject handle to excite_menu (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)% Hints: contents = get(hObject,'String') returns excite_menu contents as cell array% contents{get(hObject,'Value')} returns selected item from excite_menu contents = get(hObject,'String'); switch contents{get(hObject,'Value')} case 'Noise' set(handles.excitepos_text,'Enable','off'); otherwise set(handles.excitepos_text,'Enable','on'); end ksstringexpofn 'excitetype';% --- Executes during object creation, after setting all properties.function excite_menu_CreateFcn(hObject, eventdata, handles)% hObject handle to excite_menu (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcns called% Hint: popupmenu controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white');endfunction edit2_Callback(hObject, eventdata, handles)% hObject handle to edit2 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)% Hints: get(hObject,'String') returns contents of edit2 as text% str2double(get(hObject,'String')) returns contents of edit2 as a double% --- Executes during object creation, after setting all properties.function edit2_CreateFcn(hObject, eventdata, handles)% hObject handle to edit2 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcns called% Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white');end% --- Executes on selection change in model_menu.function model_menu_Callback(hObject, eventdata, handles)% hObject handle to model_menu (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)% Hints: contents = get(hObject,'String') returns model_menu contents as cell array% contents{get(hObject,'Value')} returns selected item from model_menu contents = get(hObject,'String'); switch contents{get(hObject,'Value')} case {'Ideal'} set(handles.loss_text,'Enable','inactive'); otherwise set(handles.loss_text,'Enable','on'); end% --- Executes during object creation, after setting all properties.function model_menu_CreateFcn(hObject, eventdata, handles)% hObject handle to model_menu (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcns called% Hint: popupmenu controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white');endfunction loss_Callback(hObject, eventdata, handles)% hObject handle to loss (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)% Hints: get(hObject,'String') returns contents of loss as text% str2double(get(hObject,'String')) returns contents of loss as a double val = str2num(get(hObject,'String')); if (val > 1) val = 1; elseif (val < 0) val = 0; end set(hObject,'String',num2str(val));% --- Executes during object creation, after setting all properties.function loss_CreateFcn(hObject, eventdata, handles)% hObject handle to loss (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcns called% Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white');endfunction frequency_text_Callback(hObject, eventdata, handles)% hObject handle to frequency_text (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)% Hints: get(hObject,'String') returns contents of frequency_text as text% str2double(get(hObject,'String')) returns contents of frequency_text as a double val = str2num(get(hObject,'String')); if (val < 1) val = 1; end set(hObject,'String',num2str(val));% --- Executes during object creation, after setting all properties.function frequency_text_CreateFcn(hObject, eventdata, handles)% hObject handle to frequency_text (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcns called% Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white');endfunction amplitude_text_Callback(hObject, eventdata, handles)% hObject handle to amplitude_text (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)% Hints: get(hObject,'String') returns contents of amplitude_text as text% str2double(get(hObject,'String')) returns contents of amplitude_text as a double val = str2num(get(hObject,'String')); if (val > 1) val = 1; elseif (val < 0) val = abs(val); end set(hObject,'String',num2str(val));% --- Executes during object creation, after setting all properties.function amplitude_text_CreateFcn(hObject, eventdata, handles)% hObject handle to amplitude_text (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcns called% Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white');endfunction excitepos_text_Callback(hObject, eventdata, handles)% hObject handle to excitepos_text (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)% Hints: get(hObject,'String') returns contents of excitepos_text as text% str2double(get(hObject,'String')) returns contents of excitepos_text as a double val = str2num(get(hObject,'String')); if (val > 0.99) val = 0.99; elseif (val < 0.01) val = 0.01; end set(hObject,'String',num2str(val));% --- Executes during object creation, after setting all properties.function excitepos_text_CreateFcn(hObject, eventdata, handles)% hObject handle to excitepos_text (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcns called% Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white');endfunction pickups_text_Callback(hObject, eventdata, handles)% hObject handle to pickups_text (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)% Hints: get(hObject,'String') returns contents of pickups_text as text% str2double(get(hObject,'String')) returns contents of pickups_text as a double % Check to see if valid positions for pickups_text [0.01, 0.99] val = get(hObject,'String'); val = str2num(val); for i=1:size(val,2) if val(i) < 0.01 val(i) = 0.01; elseif val(i) > 0.99 val(i) = 0.99; end end % Remove duplicates newval = []; for i=1:size(val,2) a = find(val==val(i)); newval = [newval val(i)];% if length(a) ~= 1% val(a(end) = val();% end end newval = sort(newval); set(hObject,'String',num2str(newval));% --- Executes during object creation, after setting all properties.function pickups_text_CreateFcn(hObject, eventdata, handles)% hObject handle to pickups_text (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcns called% Hint: edit controls usually have a white background on Windows.% See ISPC and COMPUTER.if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white');end% --- Executes on button press in synthesize.function synthesize_Callback(hObject, eventdata, handles)% hObject handle to synthesize (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) ksstringexpofn 'synthesize';% --------------------------------------------------------------------function fourierexpo_Callback(hObject, eventdata, handles)% hObject handle to fourierexpo (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) ksstringexpofn 'fourierexpo';% --------------------------------------------------------------------function sonoexpo_Callback(hObject, eventdata, handles)% hObject handle to sonoexpo (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) ksstringexpofn 'sonoexpo';
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -