最美情侣中文字幕电影,在线麻豆精品传媒,在线网站高清黄,久久黄色视频

歡迎光臨散文網(wǎng) 會員登陸 & 注冊

【圖像處理】打靶仿真系統(tǒng)含Matlab源碼

2022-04-28 07:38 作者: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});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 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');endfunction 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');endfunction 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');endfunction 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');endfunction 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');endfunction 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');endfunction 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');endfunction 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');endfunction 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');endfunction 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');endfunction 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');endfunction 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','');%獲取用戶輸入的武器參數(shù)和射擊距離,沒有輸入則獲取默認參數(shù)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);%在靶上標出位置,并且計算總環(huán)數(shù)、平均環(huán)數(shù)和命中率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;%顯示總環(huán)數(shù),平均環(huán)數(shù)和命中率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');endfunction 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');endfunction 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');endfunction 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 參考文獻


博主簡介:擅長智能優(yōu)化算法、神經(jīng)網(wǎng)絡預測、信號處理、元胞自動機、圖像處理、路徑規(guī)劃、無人機等多種領域的Matlab仿真,相關matlab代碼問題可私信交流。

部分理論引用網(wǎng)絡文獻,若有侵權聯(lián)系博主刪除。



【圖像處理】打靶仿真系統(tǒng)含Matlab源碼的評論 (共 條)

分享到微博請遵守國家法律
剑川县| 锦州市| 股票| 桐庐县| 枞阳县| 汨罗市| 佛山市| 邵阳县| 多伦县| 新蔡县| 奉节县| 绥阳县| 互助| 开原市| 忻城县| 永安市| 云浮市| 伊宁市| 乌兰浩特市| 慈溪市| 囊谦县| 万州区| 台东市| 林芝县| 门源| 绥中县| 云安县| 雅江县| 滁州市| 东光县| 志丹县| 稷山县| 东乡| 宁陕县| 灵丘县| 仁化县| 德惠市| 湖州市| 彭山县| 临汾市| 时尚|