function varargout = ballist_prob(varargin)
% BALLIST_PROB M-file for ballist_prob.fig
% BALLIST_PROB, by itself, creates a new BALLIST_PROB or raises the existing
% singleton*.
%
% H = BALLIST_PROB returns the handle to a new BALLIST_PROB or the handle to
% the existing singleton*.
%
% BALLIST_PROB('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in BALLIST_PROB.M with the given input arguments.
%
% BALLIST_PROB('Property','Value',...) creates a new BALLIST_PROB or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before ballist_prob_OpeningFunction gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to ballist_prob_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 ballist_prob
% Last Modified by GUIDE v2.5 09-Jul-2008 15:46:12
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @ballist_prob_OpeningFcn, ...
'gui_OutputFcn', @ballist_prob_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 ballist_prob is made visible.
function ballist_prob_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 ballist_prob (see VARARGIN)
% Choose default command line output for ballist_prob
handles.output = hObject;
ax2pos=get(handles.axes2,'position');
ax2x=ax2pos(1);
ax2w=ax2pos(3);
alpos=get(handles.alpha,'position');
% text('position',[(alpos(1)-ax2x)/ax2w alpos(2)+alpos(4)/2],'string','\alpha = ',...
% 'parent',handles.axes2,'VerticalAlignment','middle','HorizontalAlignment','right',...
% 'units','normalized','FontUnits','normalized','FontSize',0.0286,'interpreter','tex');
htal=text('position',[(alpos(1)-ax2x)/ax2w alpos(2)+alpos(4)/2],'string','$\alpha =\;$',...
'parent',handles.axes2,'VerticalAlignment','middle','HorizontalAlignment','right',...
'units','normalized','interpreter','latex','FontSize',10);
%get(htal,'FontSize')
%get(handles.figure1,'position')
vpos=get(handles.v,'position');
htv=text('position',[(vpos(1)-ax2x)/ax2w vpos(2)+vpos(4)/2],'string','$|\overrightarrow{V_0}| =\;$',...
'parent',handles.axes2,'VerticalAlignment','middle','HorizontalAlignment','right',...
'units','normalized','interpreter','latex','FontSize',10);
afpos=get(handles.af,'position');
htfl=text('position',[0.5 afpos(2)-alpos(4)],'string','$\overrightarrow{F_{fr}}=-p(\overrightarrow{V})$',...
'parent',handles.axes2,'VerticalAlignment','middle','HorizontalAlignment','center',...
'units','normalized','interpreter','latex','FontSize',10);
vwpos=get(handles.vw,'position');
htvw=text('position',[(vwpos(1)-ax2x)/ax2w vwpos(2)+vwpos(4)/2],'string','$V_w =\;$',...
'parent',handles.axes2,'VerticalAlignment','middle','HorizontalAlignment','right',...
'units','normalized','interpreter','latex','FontSize',10);
fud={{htal,htv,htfl,htvw}};
set(handles.figure1,'UserData',fud);
set(htfl,'visible','off');
set(handles.text3,'visible','off');
set(handles.p,'visible','off');
set(handles.text4,'visible','off');
set(handles.text13,'visible','off');
set(handles.m,'visible','off');
set(handles.text14,'visible','off');
set(handles.aw,'visible','off');
set(htvw,'visible','off');
set(handles.vw,'visible','off');
set(handles.text5,'visible','off');
set(handles.text7,'visible','off');
set(handles.axes1,'NextPlot','add');
hbd=plot(0,0,'ob','parent',handles.axes1,'MarkerSize',7); %body
xlabel(handles.axes1,'x, m');
ylabel(handles.axes1,'y, m');
als=get(handles.alpha,'string');
if get(handles.rad,'value')
al=str2num(als);
else
al=pi*str2num(als)/180;
end
V=str2num(get(handles.v,'string'));
g=str2num(get(handles.g,'string'));
S=V^2*sin(2*al)/g;
H=V^2*(sin(al))^2/(2*g);
m=max([abs(H) abs(S)]);
if cos(al)>=0
gr=plot([-m*0.2 m*1.2],[0 0],'-k','parent',handles.axes1);
set(handles.axes1,'Xlim',[-m*0.1 m*1.1],'Ylim',[-m*0.1 m*1.1]);
else
gr=plot([-m*1.2 m*0.2],[0 0],'-k','parent',handles.axes1);
set(handles.axes1,'Xlim',[-m*1.1 m*0.1],'Ylim',[-m*0.1 m*1.1]);
end
pth=plot(0,0,'r-','parent',handles.axes1);
set(pth,'visible','off');
set(handles.axes1,'UserData',{hbd,gr,pth});
% set axes equal
set(handles.axes1,'DataAspectRatio',[1 1 1],'DataAspectRatioMode','manual',...
'PlotBoxAspectRatio',[3 4 4],'PlotBoxAspectRatioMode','manual');
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes ballist_prob wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = ballist_prob_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 alpha_Callback(hObject, eventdata, handles)
% hObject handle to alpha (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 alpha as text
% str2double(get(hObject,'String')) returns contents of alpha as a double
% --- Executes during object creation, after setting all properties.
function alpha_CreateFcn(hObject, eventdata, handles)
% hObject handle to alpha (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 V_Callback(hObject, eventdata, handles)
% hObject handle to V (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 V as text
% str2double(get(hObject,'String')) returns contents of V as a double
% --- Executes during object creation, after setting all properties.
function V_CreateFcn(hObject, eventdata, handles)
% hObject handle to V (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 af.
function af_Callback(hObj
没有合适的资源?快使用搜索试试~ 我知道了~
气动学基于matlab GUI可变初始角度、速度、空气阻力、水平风弹道轨迹仿真【含Matlab源码 3183期】.zip
共5个文件
m:2个
fig:1个
jpg:1个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
5星 · 超过95%的资源 1 下载量 148 浏览量
2023-09-29
12:40:31
上传
评论 1
收藏 56KB ZIP 举报
温馨提示
CSDN海神之光上传的全部代码均可运行,亲测可用,尽我所能,为你服务; 1、代码压缩包内容 主函数:ballistics_problem.m; 调用函数:其他m文件;无需运行 运行结果效果图; 2、代码运行版本 Matlab 2019b;若运行有误,根据提示修改;若不会,可私信博主; 3、运行操作步骤 步骤一:将所有文件放到Matlab的当前文件夹中; 步骤二:双击打开ballistics_problem.m文件; 步骤三:点击运行,等程序运行完得到结果; 4、物理应用 仿真:导航、地震、电磁、电路、电能、机械、工业控制、水位控制、直流电机、平面电磁波、管道瞬变流 光学:光栅、杨氏双缝、单缝、多缝、圆孔、矩孔衍射、夫琅禾费、干涉、拉盖尔高斯、光束、光波、涡旋 定位问题:chan、taylor、RSSI、music、卡尔曼滤波UWB 气动学:弹道、气体扩散、龙格库弹道 运动学:倒立摆、泊车 天体学:卫星轨道、姿态
资源推荐
资源详情
资源评论
收起资源包目录
【气动学】基于matlab GUI可变初始角度、速度、空气阻力、水平风弹道轨迹仿真【含Matlab源码 3183期】.zip (5个子文件)
【气动学】基于matlab GUI可变初始角度、速度、空气阻力、水平风弹道轨迹仿真【含Matlab源码 3183期】
运行结果.jpg 48KB
ballistics_problem.m 58B
ballistics_problem_files
ballist_prob.fig 11KB
ballist_prob.m 24KB
ballist_prob.asv 23KB
共 5 条
- 1
资源评论
- 一帆风顺7122024-01-25资源不错,对我启发很大,获得了新的灵感,受益匪浅。
海神之光
- 粉丝: 5w+
- 资源: 6110
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功