📄 building_mode.m
字号:
function varargout = building_mode(varargin)% BUILDING_MODE M-file for building_mode.fig% BUILDING_MODE, by itself, creates a1 new BUILDING_MODE or raises the existing% singleton*.%% H = BUILDING_MODE returns the handle to a1 new BUILDING_MODE or the handle to% the existing singleton*.%% BUILDING_MODE('Property','Value',...) creates a1 new BUILDING_MODE using the% given property value pairs. Unrecognized properties are passed via% varargin to building_mode_OpeningFcn. This calling syntax produces a1% warning when there is an existing singleton*.%% BUILDING_MODE('CALLBACK') and BUILDING_MODE('CALLBACK',hObject,...) call the% local function named CALLBACK in BUILDING_MODE.M with the given input% arguments.%% *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 building_mode% Last Modified by GUIDE v2.5 19-May-2006 19:43:53% Begin initialization code - DO NOT EDITgui_Singleton = 1;gui_State = struct('gui_Name', mfilename, ... 'gui_Singleton', gui_Singleton, ... 'gui_OpeningFcn', @building_mode_OpeningFcn, ... 'gui_OutputFcn', @building_mode_OutputFcn, ... 'gui_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 building_mode is made visible.function building_mode_OpeningFcn(hObject, eventdata, handles, varargin)% This function has no output args, see OutputFcn.% hObject handle to figure% eventdata reserved - to be defined in a1 future version of MATLAB% handles structure with handles and user data (see GUIDATA)% varargin unrecognized PropertyName/PropertyValue pairs from the% command line (see VARARGIN)% Choose default command line output for building_modehandles.output = hObject;% Update handles structureguidata(hObject, handles);% UIWAIT makes building_mode wait for user response (see UIRESUME)% uiwait(handles.figure1); initialize_gui(hObject, handles);function initialize_gui(fig_handle, handles)%初始化guiset(handles.d, 'String', '');set(handles.p, 'String', '');set(handles.q, 'String', '');set(handles.A1, 'String', '');set(handles.B1, 'String', '');set(handles.A2, 'String', '');set(handles.B2, 'String','');set(handles.result, 'String', '');for ii=1:25 hold on a=[ii*6 ii*6]; b=[0 75]; plot(a,b,'g'); c=[0 150]; d=[ii*3 ii*3]; plot(c,d);%画出buildingendxlabel('wide(m)') %给X轴加标签ylabel('heiht(m)') %给Y轴加标签% --- Outputs from this function are returned to the command line.function varargout = building_mode_OutputFcn(hObject, eventdata, handles)% varargout cell array for returning output args (see VARARGOUT);% hObject handle to figure% eventdata reserved - to be defined in a1 future version of MATLAB% handles structure with handles and user data (see GUIDATA)% Get default command line output from handles structurevarargout{1} = handles.output;% --- Executes during object creation, after setting all properties.function d_CreateFcn(hObject, eventdata, handles)% hObject handle to d (see GCBO)% eventdata reserved - to be defined in a1 future version of MATLAB% handles empty - handles not created until after all CreateFcns called% Hint: edit controls usually have a1 white background on Windows.% See ISPC and COMPUTER.if ispc set(hObject,'BackgroundColor','white');else set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));endfunction d_Callback(hObject, eventdata, handles)% hObject handle to d (see GCBO)% eventdata reserved - to be defined in a1 future version of MATLAB% handles structure with handles and user data (see GUIDATA)% Hints: get(hObject,'String') returns contents of d as text% str2double(get(hObject,'String')) returns contents of d as a1 double% --- Executes during object creation, after setting all properties.function p_CreateFcn(hObject, eventdata, handles)% hObject handle to p (see GCBO)% eventdata reserved - to be defined in a1 future version of MATLAB% handles empty - handles not created until after all CreateFcns called% Hint: edit controls usually have a1 white background on Windows.% See ISPC and COMPUTER.if ispc set(hObject,'BackgroundColor','white');else set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));endfunction p_Callback(hObject, eventdata, handles)% hObject handle to p (see GCBO)% eventdata reserved - to be defined in a1 future version of MATLAB% handles structure with handles and user data (see GUIDATA)% Hints: get(hObject,'String') returns contents of p as text% str2double(get(hObject,'String')) returns contents of p as a1 double% --- Executes during object creation, after setting all properties.function q_CreateFcn(hObject, eventdata, handles)% hObject handle to q (see GCBO)% eventdata reserved - to be defined in a1 future version of MATLAB% handles empty - handles not created until after all CreateFcns called% Hint: edit controls usually have a1 white background on Windows.% See ISPC and COMPUTER.if ispc set(hObject,'BackgroundColor','white');else set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));endfunction q_Callback(hObject, eventdata, handles)% hObject handle to q (see GCBO)% eventdata reserved - to be defined in a1 future version of MATLAB% handles structure with handles and user data (see GUIDATA)% Hints: get(hObject,'String') returns contents of q as text% str2double(get(hObject,'String')) returns contents of q as a1 double% --- Executes during object creation, after setting all properties.function A1_CreateFcn(hObject, eventdata, handles)% hObject handle to A1 (see GCBO)% eventdata reserved - to be defined in a1 future version of MATLAB% handles empty - handles not created until after all CreateFcns called% Hint: edit controls usually have a1 white background on Windows.% See ISPC and COMPUTER.if ispc set(hObject,'BackgroundColor','white');else set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));endfunction A1_Callback(hObject, eventdata, handles)% hObject handle to A1 (see GCBO)% eventdata reserved - to be defined in a1 future version of MATLAB% handles structure with handles and user data (see GUIDATA)% Hints: get(hObject,'String') returns contents of A1 as text% str2double(get(hObject,'String')) returns contents of A1 as a1 double% --- Executes during object creation, after setting all properties.function B1_CreateFcn(hObject, eventdata, handles)% hObject handle to B1 (see GCBO)% eventdata reserved - to be defined in a1 future version of MATLAB% handles empty - handles not created until after all CreateFcns called% Hint: edit controls usually have a1 white background on Windows.% See ISPC and COMPUTER.if ispc set(hObject,'BackgroundColor','white');else set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));endfunction B1_Callback(hObject, eventdata, handles)% hObject handle to B1 (see GCBO)% eventdata reserved - to be defined in a1 future version of MATLAB% handles structure with handles and user data (see GUIDATA)% Hints: get(hObject,'String') returns contents of B1 as text% str2double(get(hObject,'String')) returns contents of B1 as a1 double% --- Executes during object creation, after setting all properties.function result_CreateFcn(hObject, eventdata, handles)% hObject handle to result (see GCBO)% eventdata reserved - to be defined in a1 future version of MATLAB% handles empty - handles not created until after all CreateFcns called% Hint: edit controls usually have a1 white background on Windows.% See ISPC and COMPUTER.if ispc set(hObject,'BackgroundColor','white');else set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));endfunction result_Callback(hObject, eventdata, handles)% hObject handle to result (see GCBO)% eventdata reserved - to be defined in a1 future version of MATLAB% handles structure with handles and user data (see GUIDATA)% Hints: get(hObject,'String') returns contents of result as text% str2double(get(hObject,'String')) returns contents of result as a1 double% --- Executes on button press in start.function start_Callback(hObject, eventdata, handles)% hObject handle to start (see GCBO)% eventdata reserved - to be defined in a1 future version of MATLAB% handles structure with handles and user data (see GUIDATA)initialize_gui(hObject, handles);hold [x1,y1]=getline;[A,B,d,p,q,f]=draw(x1,y1);set(handles.d, 'String', d);set(handles.p, 'String', p);set(handles.q, 'String', q);set(handles.A1, 'String', A(1));set(handles.B1, 'String', B(1));set(handles.A2, 'String', A(2));set(handles.B2, 'String', B(2));if f==1 set(handles.result, 'String', '能够接受信号');else set(handles.result, 'String', '不能接受信号');end% --- Executes during object creation, after setting all properties.function A2_CreateFcn(hObject, eventdata, handles)% hObject handle to A2 (see GCBO)% eventdata reserved - to be defined in a1 future version of MATLAB% handles empty - handles not created until after all CreateFcns called% Hint: edit controls usually have a1 white background on Windows.% See ISPC and COMPUTER.if ispc set(hObject,'BackgroundColor','white');else set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));endfunction A2_Callback(hObject, eventdata, handles)% hObject handle to A2 (see GCBO)% eventdata reserved - to be defined in a1 future version of MATLAB% handles structure with handles and user data (see GUIDATA)% Hints: get(hObject,'String') returns contents of A2 as text% str2double(get(hObject,'String')) returns contents of A2 as a1 double% --- Executes during object creation, after setting all properties.function B2_CreateFcn(hObject, eventdata, handles)% hObject handle to B2 (see GCBO)% eventdata reserved - to be defined in a1 future version of MATLAB% handles empty - handles not created until after all CreateFcns called% Hint: edit controls usually have a1 white background on Windows.% See ISPC and COMPUTER.if ispc set(hObject,'BackgroundColor','white');else set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));endfunction B2_Callback(hObject, eventdata, handles)% hObject handle to B2 (see GCBO)% eventdata reserved - to be defined in a1 future version of MATLAB% handles structure with handles and user data (see GUIDATA)% Hints: get(hObject,'String') returns contents of B2 as text% str2double(get(hObject,'String')) returns contents of B2 as a1 double
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -