function varargout = mqpGUI(varargin) % MQPGUI MATLAB code for mqpGUI.fig % MQPGUI, by itself, creates a new MQPGUI or raises the existing % singleton*. % % H = MQPGUI returns the handle to a new MQPGUI or the handle to % the existing singleton*. % % MQPGUI('CALLBACK',hObject,eventData,handles,...) calls the local % function named CALLBACK in MQPGUI.M with the given input arguments. % % MQPGUI('Property','Value',...) creates a new MQPGUI or raises the % existing singleton*. Starting from the left, property value pairs are % applied to the GUI before mqpGUI_OpeningFcn gets called. An % unrecognized property name or invalid value makes property application % stop. All inputs are passed to mqpGUI_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 mqpGUI % Last Modified by GUIDE v2.5 28-Sep-2011 13:36:17 % Begin initialization code - DO NOT EDIT gui_Singleton = 1; gui_State = struct('gui_Name', mfilename, ... 'gui_Singleton', gui_Singleton, ... 'gui_OpeningFcn', @mqpGUI_OpeningFcn, ... 'gui_OutputFcn', @mqpGUI_OutputFcn, ... 'gui_LayoutFcn', [] , ... 'gui_Callback', []); if nargin && ischar(varargin{1}) gui_State.gui_Callback = str2func(varargin{1}); end if 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 mqpGUI is made visible. function mqpGUI_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 mqpGUI (see VARARGIN) % Choose default command line output for mqpGUI handles.output = hObject; % Update handles structure guidata(hObject, handles); % UIWAIT makes mqpGUI wait for user response (see UIRESUME) % uiwait(handles.figure1); % --- Outputs from this function are returned to the command line. function varargout = mqpGUI_OutputFcn(hObject, eventdata, handles) % varargout cell array for returning output args (see VARARGOUT); % hObject handle to figure % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Get default command line output from handles structure varargout{1} = handles.output; function transmitGainMag_Callback(hObject, eventdata, handles) % hObject handle to transmitGainMag (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 transmitGainMag as text % str2double(get(hObject,'String')) returns contents of transmitGainMag as a double % --- Executes during object creation, after setting all properties. function transmitGainMag_CreateFcn(hObject, eventdata, handles) % hObject handle to transmitGainMag (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 function freq_Callback(hObject, eventdata, handles) % hObject handle to freq (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 freq as text % str2double(get(hObject,'String')) returns contents of freq as a double % --- Executes during object creation, after setting all properties. function freq_CreateFcn(hObject, eventdata, handles) % hObject handle to freq (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 function receiveGainMag_Callback(hObject, eventdata, handles) % hObject handle to receiveGainMag (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 receiveGainMag as text % str2double(get(hObject,'String')) returns contents of receiveGainMag as a double % --- Executes during object creation, after setting all properties. function receiveGainMag_CreateFcn(hObject, eventdata, handles) % hObject handle to receiveGainMag (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 function transmitBeamwidth_Callback(hObject, eventdata, handles) % hObject handle to transmitBeamwidth (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 transmitBeamwidth as text % str2double(get(hObject,'String')) returns contents of transmitBeamwidth as a double % --- Executes during object creation, after setting all properties. function transmitBeamwidth_CreateFcn(hObject, eventdata, handles) % hObject handle to transmitBeamwidth (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 function receiveBeamwidth_Callback(hObject, eventdata, handles) % hObject handle to receiveBeamwidth (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 receiveBeamwidth as text % str2double(get(hObject,'String')) returns contents of receiveBeamwidth as a double % --- Executes during object creation, after setting all properties. function receiveBeamwidth_CreateFcn(hObject, eventdata, handles) % hObject handle to receiveBeamwidth (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 function transmitRows_Callback(hObject, eventdata, handles) % hObject handle to transmitRows (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 transmitRows as text % str2double(get(hObject,'String')) returns contents of transmitRows as a double % --- Executes during object creation, after setting all properties. function transmitRows_CreateFcn(hObject, eventdata, handles) % hObject handle to transmitRows (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 function transmitColumns_Callback(hObject, eventdata, handles) % hObject handle to transmitColumns (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 transmitColumns as text % str2double(get(hObject,'String')) returns contents of transmitColumns as a double % --- Executes during object creation, after setting all properties. function transmitColumns_CreateFcn(hObject, eventdata, handles) % hObject handle to transmitColumns (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 function receiveRows_Callback(hObject, eventdata, handles) % hObject handle to receiveRows (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 receiveRows as text % str2double(get(hObject,'String')) returns contents of receiveRows as a double % --- Executes during object creation, after setting all properties. function receiveRows_CreateFcn(hObject, eventdata, handles) % hObject handle to receiveRows (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 function receiveColumns_Callback(hObject, eventdata, handles) % hObject handle to receiveColumns (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 receiveColumns as text % str2double(get(hObject,'String')) returns contents of receiveColumns as a double % --- Executes during object creation, after setting all properties. function receiveColumns_CreateFcn(hObject, eventdata, handles) % hObject handle to receiveColumns (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 function arrayDistance_Callback(hObject, eventdata, handles) % hObject handle to arrayDistance (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 arrayDistance as text % str2double(get(hObject,'String')) returns contents of arrayDistance as a double % --- Executes during object creation, after setting all properties. function arrayDistance_CreateFcn(hObject, eventdata, handles) % hObject handle to arrayDistance (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 pushbutton1. function pushbutton1_Callback(hObject, eventdata, handles) % hObject handle to pushbutton1 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) frequency = str2double(get(handles.freq, 'String')); transmitGaindB = str2double(get(handles.transmitGainMag, 'String')); transmitBeamwidthDegrees = str2double(get(handles.transmitBeamwidth, 'String')); receiveGaindB = str2double(get(handles.receiveGainMag, 'String')); receiveBeamwidthDegrees = str2double(get(handles.receiveBeamwidth, 'String')); numTransmitColumns = str2double(get(handles.transmitColumns, 'String')); numTransmitRows = str2double(get(handles.transmitRows, 'String')); numReceiveColumns = str2double(get(handles.receiveColumns, 'String')); numReceiveRows = str2double(get(handles.receiveRows, 'String')); arraySpacingInches = str2double(get(handles.arrayDistance, 'String')); receiveXIndex = str2double(get(handles.receiveXIndex, 'String')); receiveYIndex = str2double(get(handles.receiveYIndex, 'String')); transmitXIndex = str2double(get(handles.transmitXIndex, 'String')); transmitYIndex = str2double(get(handles.transmitYIndex, 'String')); [elementElementCoupling, elementCoupling, totalCoupling] = couple( frequency, transmitGaindB, transmitBeamwidthDegrees, receiveGaindB, receiveBeamwidthDegrees, numTransmitColumns, numTransmitRows, numReceiveColumns, numReceiveRows, arraySpacingInches, receiveXIndex, receiveYIndex, transmitXIndex, transmitYIndex ); set(handles.elementElementResult, 'String', strcat('element-element coupling: ', num2str(elementElementCoupling), ' dB')); set(handles.elementResult, 'String', strcat('array-element coupling: ', num2str(elementCoupling), ' dB')); set(handles.arrayResult, 'String', strcat('array-array coupling: ', num2str(totalCoupling), ' dB')); % --- Executes during object creation, after setting all properties. function pushbutton1_CreateFcn(hObject, eventdata, handles) % hObject handle to pushbutton1 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called function transmitXIndex_Callback(hObject, eventdata, handles) % hObject handle to transmitXIndex (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 transmitXIndex as text % str2double(get(hObject,'String')) returns contents of transmitXIndex as a double % --- Executes during object creation, after setting all properties. function transmitXIndex_CreateFcn(hObject, eventdata, handles) % hObject handle to transmitXIndex (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 function transmitYIndex_Callback(hObject, eventdata, handles) % hObject handle to transmitYIndex (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 transmitYIndex as text % str2double(get(hObject,'String')) returns contents of transmitYIndex as a double % --- Executes during object creation, after setting all properties. function transmitYIndex_CreateFcn(hObject, eventdata, handles) % hObject handle to transmitYIndex (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 function receiveXIndex_Callback(hObject, eventdata, handles) % hObject handle to receiveXIndex (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 receiveXIndex as text % str2double(get(hObject,'String')) returns contents of receiveXIndex as a double % --- Executes during object creation, after setting all properties. function receiveXIndex_CreateFcn(hObject, eventdata, handles) % hObject handle to receiveXIndex (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 function receiveYIndex_Callback(hObject, eventdata, handles) % hObject handle to receiveYIndex (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 receiveYIndex as text % str2double(get(hObject,'String')) returns contents of receiveYIndex as a double % --- Executes during object creation, after setting all properties. function receiveYIndex_CreateFcn(hObject, eventdata, handles) % hObject handle to receiveYIndex (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 % -------------------------------------------------------------------- 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)