function varargout = rear_end(varargin)
% REAR_END MATLAB code for rear_end.fig
% REAR_END, by itself, creates a new REAR_END or raises the existing
% singleton*.
%
% H = REAR_END returns the handle to a new REAR_END or the handle to
% the existing singleton*.
%
% REAR_END('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in REAR_END.M with the given input arguments.
%
% REAR_END('Property','Value',...) creates a new REAR_END or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before rear_end_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to rear_end_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 rear_end
% Last Modified by GUIDE v2.5 08-May-2014 11:23:26
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @rear_end_OpeningFcn, ...
'gui_OutputFcn', @rear_end_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 rear_end is made visible.
function rear_end_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 rear_end (see VARARGIN)
% Choose default command line output for rear_end
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes rear_end wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = rear_end_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;
% --- 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)
close(rear_end);
% --- Executes on button press in pushbutton2.
function pushbutton2_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global RoadInfor;
global V1Infor;
global V2Infor;
global AEBInfor;
global VehicleshapeInfor;
global AEBdetectshapeInfor;
global data;
[RoadInfor,V1Infor,V2Infor,AEBInfor,VehicleshapeInfor,AEBdetectshapeInfor]=initsystem(handles);%初始化系统
[V1Infor,V2Infor]=Drawinit(handles,RoadInfor,V1Infor,V2Infor,AEBInfor,VehicleshapeInfor,AEBdetectshapeInfor);%初始化车辆画图
data=DataDrawinit(handles);%初始化数据画图
% --- Executes on button press in pushbutton3.
function pushbutton3_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton3 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global data;
global time;
global timespace;
global dataover;
Drawdata(handles,data,time,timespace,dataover);%画数据图
% --- Executes on button press in pushbutton4.
function pushbutton4_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton4 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global RoadInfor;
global V1Infor;
global V2Infor;
global AEBInfor;
global VehicleshapeInfor;
global AEBdetectshapeInfor;
global data;
global AEBV1shape;
global AEBV2shape;
global V1n;
global V2n;
global V1fn;
global V2fn;
global stopframe;
global time;
global timespace;
global dataover;
%初始化车辆
V1n=V1Infor;
V2n=V2Infor;
%初始化仿真车辆
V1fn=V1Infor;
V2fn=V2Infor;
AEBV1shape=AEBdetectshapeInfor;
AEBV2shape=AEBdetectshapeInfor;
stopframe=0;%停止指针
dataover=0;%数据超出指针
time=1;%时间指针
timespace=0.05;%时间间隔为0.05秒
%开始车辆运算
[data,V1n,V2n,V1fn,V2fn]=adddata1(handles,V1n,V2n,V1fn,V2fn,data,AEBInfor);%填写第一指针
while(stopframe==0)
time=time+1;%时间增加
data.ptr=data.ptr+1;%数据指针增加
if data.ptr>data.datamaxNum
data.ptr=1;
dataover=dataover+1;
end
[V1n,V2n,data]=RealAccident(handles,RoadInfor,VehicleshapeInfor,V1n,V2n,data,time,timespace);%真实事故在现
[V1fn,V2fn,AEBV1shape,AEBV2shape,data]=AEBAccident(handles,V1Infor,V2Infor,RoadInfor,AEBInfor,VehicleshapeInfor,V1fn,V2fn,AEBV1shape,AEBV2shape,data,time,timespace);%AEB系统仿真
Drawdata(handles,data,time,timespace,dataover);%画数据图
if data.ptr>10&&data.speed(1,data.ptr-9)==0&&data.speed(2,data.ptr-9)==0&&data.speed(3,data.ptr-9)==0&&data.speed(4,data.ptr-9)==0%判断停止指针
stopframe=1;
end
end
% --- Executes on selection change in curvestyle.
function curvestyle_Callback(hObject, eventdata, handles)
% hObject handle to curvestyle (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: contents = cellstr(get(hObject,'String')) returns curvestyle contents as cell array
% contents{get(hObject,'Value')} returns selected item from curvestyle
% --- Executes during object creation, after setting all properties.
function curvestyle_CreateFcn(hObject, eventdata, handles)
% hObject handle to curvestyle (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');
end
function roadlen_Callback(hObject, eventdata, handles)
% hObject handle to roadlen (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 roadlen as text
% str2double(get(hObject,'String')) returns contents of roadlen as a double
% --- Executes during object creation, after setting all properties.
function roadlen_CreateFcn(hObject, eventdata, handles)
% hObject handle to roadlen (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 AEBcondition.
function AEBcondition_Callback(hObject, eventdata, handles)
% hObject handle to AEBcondition (see GCBO)
% eventdata reserved - to be defined in a future version
AEB简要有效性验证程序
需积分: 49 166 浏览量
2019-01-30
15:20:34
上传
评论 5
收藏 553KB ZIP 举报
lixudon1
- 粉丝: 1
- 资源: 2
最新资源
- tensorflow-gpu-2.5.0-cp39-cp39-manylinux2010-x86-64.whl
- tensorflow-gpu-2.5.2-cp39-cp39-manylinux2010-x86-64.whl
- 内含方正小标宋简体、仿宋-Gb2312、黑体、楷体、宋体,五个公文常用字体
- 记忆卡牌游戏源码及可运行文件
- 利用wps的js宏编写的一键格式修改辅助工具
- 基于matlab实现训练RBF网络的,但用的算法是梯度下降法,算法仍然是自己写的.rar
- 基于matlab实现小波分析改造后,可以分析脑电数据的程序,出现32个导联每个通道的功率谱.rar
- 基于matlab实现物体的应力和应变DIC-通过识别一系列图像的变形得到物体的应力和应变
- 基于matlab实现文档+程序NSGA-II多目标优化的matlab代码.rar
- 基于matlab实现文档+程序 多目标优化,NSGA2算法实现.rar
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈