function varargout = wodedianti(varargin)
% WODEDIANTI M-file for wodedianti.fig
% WODEDIANTI, by itself, creates a new WODEDIANTI or raises the existing
% singleton*.
%
% H = WODEDIANTI returns the handle to a new WODEDIANTI or the handle to
% the existing singleton*.
%
% WODEDIANTI('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in WODEDIANTI.M with the given input arguments.
%
% WODEDIANTI('Property','Value',...) creates a new WODEDIANTI or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before wodedianti_OpeningFunction gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to wodedianti_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 wodedianti
% Last Modified by GUIDE v2.5 27-Dec-2020 11:47:37
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @wodedianti_OpeningFcn, ...
'gui_OutputFcn', @wodedianti_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 wodedianti is made visible.
function wodedianti_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 wodedianti (see VARARGIN)
% Choose default command line output for wodedianti
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes wodedianti wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = wodedianti_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;
global k;
k=0;
global k1;
global x1;
global x2;
global y1;
global s0;
s0=0;
global s1;
global s2;
global s3;
global s4;
global s5;
global s6;
global s7;
global s8;
global door1;
global door2;
global e1;
axes(handles.axes1);
axis([-2.0,15.0,-2.0,15.0])%坐标轴的范围
hold on
fill([-2,15,15,-2],[-2,-2,15,15],[0.4,0.2,0.2]);
x1=[9.5 9.5 10 10];
y1=[1 0 0 1];
x2=[10 10 10.5 10.5];
text(0,4,'学号:100408623 100408921','fontsize',15,'color','c');
text(0,5,'姓名:沈霄 龙阳莉','fontsize',15,'color','c');
text(-1,9,'上升','fontsize',10,'color','c');
text(4,9,'下降','fontsize',10,'color','c');
text(6,11.5,'控制电机','fontsize',10,'color','c');
text(11.5,0,'一楼','fontsize',10,'color','c');
text(11.5,1,'二楼','fontsize',10,'color','c');
text(11.5,2,'三楼','fontsize',10,'color','c');
text(11.5,3,'四楼','fontsize',10,'color','c');
text(11.5,4,'五楼','fontsize',10,'color','c');
text(11.5,5,'六楼','fontsize',10,'color','c');
text(11.5,6,'七楼','fontsize',10,'color','c');
text(11.5,7,'八楼','fontsize',10,'color','c');
text(11.5,8,'九楼','fontsize',10,'color','c');
text(11.5,9,'十楼','fontsize',10,'color','c');
l0=line([11;11],[0;10],'color','c','linestyle','-','linewidth',2);
line([11;11.2],[0;0],'color','r','linestyle','-','linewidth',2);
line([11;11.2],[1;1],'color','r','linestyle','-','linewidth',2);
line([11;11.2],[2;2],'color','r','linestyle','-','linewidth',2);
line([11;11.2],[3;3],'color','r','linestyle','-','linewidth',2);
line([11;11.2],[4;4],'color','r','linestyle','-','linewidth',2);
line([11;11.2],[5;5],'color','r','linestyle','-','linewidth',2);
line([11;11.2],[6;6],'color','r','linestyle','-','linewidth',2);
line([11;11.2],[7;7],'color','r','linestyle','-','linewidth',2);
line([11;11.2],[8;8],'color','r','linestyle','-','linewidth',2);
line([11;11.2],[9;9],'color','r','linestyle','-','linewidth',2);
l1=line([2;5.5],[13;13],'color','c','linestyle','-','linewidth',2);
l2=line([2;2],[11;13],'color','c','linestyle','-','linewidth',2);
l3=line([1;1],[9;11],'color','c','linestyle','-','linewidth',2);
l4=line([3;3],[9;11],'color','c','linestyle','-','linewidth',2);
l5=line([1;3],[11;11],'color','c','linestyle','-','linewidth',2);%绘制导线
k1=line([2;1],[8;9],'color','r','linestyle','-','linewidth',2);%单刀双掷开关
door1=patch(x1,y1,[0 1 1]);
door2=patch(x2,y1,[0 1 1]);%画电梯的两面门
t=0:pi/100:2*pi;
fill(6+0.5*sin(t),13+cos(t),[0.7,0.85,0.9]);%电机左端
fill(8.5+0.5*sin(t),13+cos(t),[0.7,0.85,0.9]);%电机右端
e0=line([9;10],[13;13],'color','r','linewidth',2);%
e1=line([10;10],[1;13],'color','b','linewidth',2);%连接电机中轴和电梯的线
s1=line([6;8.5],[14;14],'color','c','linestyle','-','linewidth',2);
s2=line([6;8.5],[12;12],'color','m','linestyle','-','linewidth',2);
s3=line([6;8.5],[14;14],'color','b','linestyle','-','linewidth',2);
s4=line([6;8.5],[12;12],'color','w','linestyle','-','linewidth',2);
s5=line([6;8.5],[14;14],'color','k','linestyle','-','linewidth',2);
s6=line([6;8.5],[12;12],'color','g','linestyle','-','linewidth',2);
s7=line([6;8.5],[14;14],'color','r','linestyle','-','linewidth',2);
s8=line([6;8.5],[12;12],'color','b','linestyle','-','linewidth',2);
%电梯上升函数:
function y=moveup(f1,f2)
global k;%全局变量
global k1;%全局变量
global x1;%全局变量
global x2;%全局变量
global y1;%全局变量
global s0;%全局变量
global s1;%全局变量
global s2;%全局变量
global s3;%全局变量
global s4;%全局变量
global s5;%全局变量
global s6;%全局变量
global s7;%全局变量
global s8;%全局变量
global door1;%全局变量
global door2;%全局变量
global e1;%全局变量
a=0; %设定电机运转的初始角度
da=0.05;%设定电机正转的条件
s=f1; %设定门运动的初始条件
ds=0.05;%设定门运动的周期
while s<f2 %条件表达式 (当p1<s<p2时,电机正转,门上升)
a=a+da;
xa1=6+abs(0.5*sin(a)); %当线运动到电机背面时会覆盖电机左端,用abs可解决这一问题增强逼真感)
xa2=8.5+0.5*sin(a);
ya1=13+cos(a);
ya2=13+cos(a);%设定s1的两端点坐标(s1是对应0的线)
xb1=6+0.5*abs(sin(a+pi));
xb2=8.5+0.5*sin(a+pi);
yb1=13+cos(a+pi);
yb2=13+cos(a+pi); %设定s2的两端点坐标(s2是对应pi的线)
xc1=6+abs(0.5*sin(a+pi/2));
xc2=8.5+0.5*sin(a+pi/2);
yc1=13+cos(a+pi/2);
yc2=13+cos(a+pi/2);%设定s3的两端点坐标(s3是对应pi/2的线)
xd1=6+0.5*abs(sin(a-pi/2));
xd2=8.5+0.5*sin(a-pi/2);
yd1=13+cos(a-pi/2);
yd2=13+cos(a-pi/2);%设定s4的两端点坐标(s4是对应-pi/2的线)
xe1=6+abs(0.5*sin(a+pi/4));
xe2=8.5+0.5*sin(a+pi/4);
ye1=13+cos(a+pi/4);
ye2=13+cos(a+pi/4);%设定s5的两端点坐标(s5是对应pi/4的线)
xf1=6+0.5*abs(sin(a+pi*3/4));
xf2=8.5+0.5*sin(a+pi*3/4);
yf1=13+cos(a+pi*3/4);
yf2=13+cos(a+pi*3/4);%设定s6的两端点坐标(s6是对应pi*3/4的线)
xg1=6+abs(0.5*sin(a-pi*3/4));
xg2=8.5+0.5*sin(a-3*pi/4);
yg1=13+cos(a-3*pi/4);
yg2=13+cos(a-3*pi/4);%设定s7的两端点坐标(s7是对应-3*pi/4的线)
xh1=6+0.5*abs(sin(a-pi/4));
xh2=8.5+0.5*sin(a-pi/4);
yh1=13+cos(a-pi/4);
yh2=13+cos(a-pi/4); %设定s8的两端点坐标(s8是对应-pi/4的线)
set(s1,'xdata',[xa1;xa2],'ydata',[ya1;ya2]);
set(s2,'xd
没有合适的资源?快使用搜索试试~ 我知道了~
机械仿真基于matlab GUI智能电梯仿真系统【含Matlab源码 1087期】.zip
共22个文件
m:9个
fig:6个
asv:4个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
5星 · 超过95%的资源 3 下载量 100 浏览量
2021-09-23
21:33:40
上传
评论 3
收藏 6.67MB ZIP 举报
温馨提示
CSDN海神之光上传的全部代码均可运行,亲测可用,尽我所能,为你服务; 1、代码压缩包内容 主函数:dianti.m; 调用函数:其他m文件;无需运行 运行结果效果图; 2、代码运行版本 Matlab 2019b;若运行有误,根据提示修改;若不会,可私信博主; 3、运行操作步骤 步骤一:将所有文件放到Matlab的当前文件夹中; 步骤二:双击打开dianti.m文件; 步骤三:点击运行,等程序运行完得到结果; 4、物理应用 仿真:导航、地震、电磁、电路、电能、机械、工业控制、水位控制、直流电机、平面电磁波、管道瞬变流 光学:光栅、杨氏双缝、单缝、多缝、圆孔、矩孔衍射、夫琅禾费、干涉、拉盖尔高斯、光束、光波、涡旋 定位问题:chan、taylor、RSSI、music、卡尔曼滤波UWB 气动学:弹道、气体扩散、龙格库弹道 运动学:倒立摆、泊车 天体学:卫星轨道、姿态
资源推荐
资源详情
资源评论
收起资源包目录
【机械仿真】基于matlab GUI智能电梯仿真系统【含Matlab源码 1087期】.zip (22个子文件)
【机械仿真】基于matlab GUI智能电梯仿真系统【含Matlab源码 1087期】
wodedianti.asv 19KB
lift.fig 3KB
lift.m 5KB
no1.m 5KB
lift1.m 5KB
运行结果1.JPG 77KB
dianti.fig 3KB
autodoor.m 8KB
dianti2.asv 7KB
dianti.m 13KB
wodedianti.fig 3KB
dianti.asv 13KB
untitled.m 3KB
dianti22.asv 9KB
lift1.fig 3KB
shen.wav 6.7MB
untitled.fig 1KB
dianti2.m 7KB
运行结果2.jpg 15KB
wodedianti.m 19KB
no1.fig 3KB
dianti22.m 9KB
共 22 条
- 1
资源评论
- shwnalin76882024-04-20感谢资源主的分享,很值得参考学习,资源价值较高,支持!
- qq_432347072022-04-16用户下载后在一定时间内未进行评价,系统默认好评。
海神之光
- 粉丝: 5w+
- 资源: 6110
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功