IT数码 购物 网址 头条 软件 日历 阅读 图书馆
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
图片批量下载器
↓批量下载图片,美女图库↓
图片自动播放器
↓图片自动播放器↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
开发: C++知识库 Java知识库 JavaScript Python PHP知识库 人工智能 区块链 大数据 移动开发 嵌入式 开发工具 数据结构与算法 开发测试 游戏开发 网络协议 系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程
数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁
 
   -> 人工智能 -> 【图像处理】打靶仿真系统含Matlab源码 -> 正文阅读

[人工智能]【图像处理】打靶仿真系统含Matlab源码

1 简介

?2 部分代码

function varargout = target_export(varargin)% TARGET_EXPORT M-file for target_export.fig%      TARGET_EXPORT, by itself, creates a new TARGET_EXPORT or raises the existing%      singleton*.%%      H = TARGET_EXPORT returns the handle to a new TARGET_EXPORT or the handle to%      the existing singleton*.%%      TARGET_EXPORT('CALLBACK',hObject,eventData,handles,...) calls the local%      function named CALLBACK in TARGET_EXPORT.M with the given input arguments.%%      TARGET_EXPORT('Property','Value',...) creates a new TARGET_EXPORT or raises the%      existing singleton*.  Starting from the left, property value pairs are%      applied to the GUI before target_export_OpeningFcn gets called.  An%      unrecognized property name or invalid value makes property application%      stop.  All inputs are passed to target_export_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 target_export?% Last Modified by GUIDE v2.5 09-Dec-2010 23:29:22?% Begin initialization code - DO NOT EDITgui_Singleton = 1;gui_State = struct('gui_Name',       mfilename, ...                   'gui_Singleton',  gui_Singleton, ...                   'gui_OpeningFcn', @target_export_OpeningFcn, ...                   'gui_OutputFcn',  @target_export_OutputFcn, ...                   'gui_LayoutFcn',  @target_export_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 target_export is made visible.function target_export_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 target_export (see VARARGIN)?%画靶子draw;?% Choose default command line output for target_exporthandles.output = hObject;?% Update handles structureguidata(hObject, handles);?% UIWAIT makes target_export wait for user response (see UIRESUME)% uiwait(handles.figure1);??% --- Outputs from this function are returned to the command line.function varargout = target_export_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 structurevarargout{1} = handles.output;??% --- Executes on button press in close.function close_Callback(hObject, eventdata, handles)% hObject    handle to close (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)close;???function uh_input_Callback(hObject, eventdata, handles)% hObject    handle to uh_input (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 uh_input as text%        str2double(get(hObject,'String')) returns contents of uh_input as a double??% --- Executes during object creation, after setting all properties.function uh_input_CreateFcn(hObject, eventdata, handles)% hObject    handle to uh_input (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 vh_input_Callback(hObject, eventdata, handles)% hObject    handle to vh_input (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 vh_input as text%        str2double(get(hObject,'String')) returns contents of vh_input as a double??% --- Executes during object creation, after setting all properties.function vh_input_CreateFcn(hObject, eventdata, handles)% hObject    handle to vh_input (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 vr_input_Callback(hObject, eventdata, handles)% hObject    handle to vr_input (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 vr_input as text%        str2double(get(hObject,'String')) returns contents of vr_input as a double??% --- Executes during object creation, after setting all properties.function vr_input_CreateFcn(hObject, eventdata, handles)% hObject    handle to vr_input (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 ur_input_Callback(hObject, eventdata, handles)% hObject    handle to ur_input (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 ur_input as text%        str2double(get(hObject,'String')) returns contents of ur_input as a double??% --- Executes during object creation, after setting all properties.function ur_input_CreateFcn(hObject, eventdata, handles)% hObject    handle to ur_input (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 ah_input_Callback(hObject, eventdata, handles)% hObject    handle to ah_input (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 ah_input as text%        str2double(get(hObject,'String')) returns contents of ah_input as a double??% --- Executes during object creation, after setting all properties.function ah_input_CreateFcn(hObject, eventdata, handles)% hObject    handle to ah_input (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 ar_input_Callback(hObject, eventdata, handles)% hObject    handle to ar_input (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 ar_input as text%        str2double(get(hObject,'String')) returns contents of ar_input as a double??% --- Executes during object creation, after setting all properties.function ar_input_CreateFcn(hObject, eventdata, handles)% hObject    handle to ar_input (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 bh_input_Callback(hObject, eventdata, handles)% hObject    handle to bh_input (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 bh_input as text%        str2double(get(hObject,'String')) returns contents of bh_input as a double??% --- Executes during object creation, after setting all properties.function bh_input_CreateFcn(hObject, eventdata, handles)% hObject    handle to bh_input (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 br_input_Callback(hObject, eventdata, handles)% hObject    handle to br_input (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 br_input as text%        str2double(get(hObject,'String')) returns contents of br_input as a double??% --- Executes during object creation, after setting all properties.function br_input_CreateFcn(hObject, eventdata, handles)% hObject    handle to br_input (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 distance_input_Callback(hObject, eventdata, handles)% hObject    handle to distance_input (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 distance_input as text%        str2double(get(hObject,'String')) returns contents of distance_input as a double??% --- Executes during object creation, after setting all properties.function distance_input_CreateFcn(hObject, eventdata, handles)% hObject    handle to distance_input (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 sum_output_Callback(hObject, eventdata, handles)% hObject    handle to sum_output (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 sum_output as text%        str2double(get(hObject,'String')) returns contents of sum_output as a double??% --- Executes during object creation, after setting all properties.function sum_output_CreateFcn(hObject, eventdata, handles)% hObject    handle to sum_output (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 average_output_Callback(hObject, eventdata, handles)% hObject    handle to average_output (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 average_output as text%        str2double(get(hObject,'String')) returns contents of average_output as a double??% --- Executes during object creation, after setting all properties.function average_output_CreateFcn(hObject, eventdata, handles)% hObject    handle to average_output (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 n_output_Callback(hObject, eventdata, handles)% hObject    handle to n_output (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 n_output as text%        str2double(get(hObject,'String')) returns contents of n_output as a double??% --- Executes during object creation, after setting all properties.function n_output_CreateFcn(hObject, eventdata, handles)% hObject    handle to n_output (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 start.function start_Callback(hObject, eventdata, handles)% hObject    handle to start (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)?%画靶子draw;?%清除输出结果set(handles.sum_output,'string','');set(handles.average_output,'string','');set(handles.n_output,'string','');set(handles.out1,'string','');set(handles.out2,'string','');set(handles.out3,'string','');set(handles.out4,'string','');set(handles.out5,'string','');set(handles.out6,'string','');set(handles.out7,'string','');set(handles.out8,'string','');set(handles.out9,'string','');set(handles.out10,'string','');?%获取用户输入的武器参数和射击距离,没有输入则获取默认参数uh=str2double(get(handles.uh_input,'string'));ur=str2double(get(handles.ur_input,'string'));vh=str2double(get(handles.vh_input,'string'));vr=str2double(get(handles.vr_input,'string'));ah=str2double(get(handles.ah_input,'string'));ar=str2double(get(handles.ar_input,'string'));bh=str2double(get(handles.bh_input,'string'));br=str2double(get(handles.br_input,'string'));distance=str2double(get(handles.distance_input,'string'));?%计算武器瞄准偏差和射弹散布偏差Eh=uh*exp(vh*distance);Er=vr*exp(vh*distance);Bh=ah*power(distance,bh);Br=ar*power(distance,br);?%在靶上标出位置,并且计算总环数、平均环数和命中率sum=0;average=0;n=0;single_score=0;?for m=1:10    h1=normrnd(0,Eh);    r1=normrnd(0,Er);    h2=normrnd(0,Bh);    r2=normrnd(0,Br);    h=(h1+h2)*10;    r=(r1+r2)*10;        %添加声音,其实是我自己录的音    [y,fs]=wavread('ak47.wav');    sound(y,fs);        switch fix(4*sqrtm(h.^2+r.^2))        case {0,1,2}            sum=sum+10;            n=n+1;            single_score=10;            axes(handles.target);            plot(h,r,'+');        case {3,4,5,6}            sum=sum+9;            n=n+1;            single_score=9;            axes(handles.target);            plot(h,r,'+');        case {7,8,9,10}            sum=sum+8;            n=n+1;            single_score=8;            axes(handles.target);            plot(h,r,'+');        case {11,12,13,14}            sum=sum+7;            n=n+1;            single_score=7;            axes(handles.target);            plot(h,r,'+');        case {15,16,17,18}            sum=sum+6;            n=n+1;            single_score=6;            axes(handles.target);            plot(h,r,'+');        otherwise            sum=sum;            n=n;            single_score=0;    end        %输出单词的结果    switch m        case 1            set(handles.out1,'string',num2str(single_score));        case 2            set(handles.out2,'string',num2str(single_score));        case 3            set(handles.out3,'string',num2str(single_score));        case 4            set(handles.out4,'string',num2str(single_score));        case 5            set(handles.out5,'string',num2str(single_score));        case 6            set(handles.out6,'string',num2str(single_score));        case 7            set(handles.out7,'string',num2str(single_score));        case 8            set(handles.out8,'string',num2str(single_score));        case 9            set(handles.out9,'string',num2str(single_score));        case 10            set(handles.out10,'string',num2str(single_score));    end    pause(1);endaverage=sum/10;score=10*n;?%显示总环数,平均环数和命中率set(handles.sum_output,'string',num2str(sum));set(handles.average_output,'string',num2str(average));set(handles.n_output,'string',num2str(score));?%弹出对话框,提示仿真完毕helpdlg('仿真结束','提示');?% --- Executes on button press in clear.function clear_Callback(hObject, eventdata, handles)% hObject    handle to clear (see GCBO)% eventdata  reserved - to be defined in a future version of MATLAB% handles    structure with handles and user data (see GUIDATA)?%画靶子draw;?%清除输出结果set(handles.sum_output,'string','');set(handles.average_output,'string','');set(handles.n_output,'string','');set(handles.out1,'string','');set(handles.out2,'string','');set(handles.out3,'string','');set(handles.out4,'string','');set(handles.out5,'string','');set(handles.out6,'string','');set(handles.out7,'string','');set(handles.out8,'string','');set(handles.out9,'string','');set(handles.out10,'string','');?function out1_Callback(hObject, eventdata, handles)% hObject    handle to out1 (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 out1 as text%        str2double(get(hObject,'String')) returns contents of out1 as a double??% --- Executes during object creation, after setting all properties.function out1_CreateFcn(hObject, eventdata, handles)% hObject    handle to out1 (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 out2_Callback(hObject, eventdata, handles)% hObject    handle to out2 (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 out2 as text%        str2double(get(hObject,'String')) returns contents of out2 as a double??% --- Executes during object creation, after setting all properties.function out2_CreateFcn(hObject, eventdata, handles)% hObject    handle to out2 (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 out3_Callback(hObject, eventdata, handles)% hObject    handle to out3 (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 out3 as text%        str2double(get(hObject,'String')) returns contents of out3 as a double??% --- Executes during object creation, after setting all properties.function out3_CreateFcn(hObject, eventdata, handles)% hObject    handle to out3 (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 out4_Callback(hObject, eventdata, handles)% hObject    handle to out4 (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 out4 as text%        str2double(get(hObject,'String')) returns contents of out4 as a double????

3 仿真结果

4 参考文献

博主简介:擅长智能优化算法、神经网络预测、信号处理、元胞自动机、图像处理、路径规划、无人机等多种领域的Matlab仿真,相关matlab代码问题可私信交流。

部分理论引用网络文献,若有侵权联系博主删除。

  人工智能 最新文章
2022吴恩达机器学习课程——第二课(神经网
第十五章 规则学习
FixMatch: Simplifying Semi-Supervised Le
数据挖掘Java——Kmeans算法的实现
大脑皮层的分割方法
【翻译】GPT-3是如何工作的
论文笔记:TEACHTEXT: CrossModal Generaliz
python从零学(六)
详解Python 3.x 导入(import)
【答读者问27】backtrader不支持最新版本的
上一篇文章      下一篇文章      查看所有文章
加:2022-04-29 12:08:38  更:2022-04-29 12:09:29 
 
开发: C++知识库 Java知识库 JavaScript Python PHP知识库 人工智能 区块链 大数据 移动开发 嵌入式 开发工具 数据结构与算法 开发测试 游戏开发 网络协议 系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程
数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁

360图书馆 购物 三丰科技 阅读网 日历 万年历 2024年11日历 -2024/11/26 8:48:41-

图片自动播放器
↓图片自动播放器↓
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
图片批量下载器
↓批量下载图片,美女图库↓
  网站联系: qq:121756557 email:121756557@qq.com  IT数码