在matlab中以图像中心为旋转轴逆时针旋转30度自编程序,该程序每10度一组数据,如何改成每30度一组呢????...

该楼层疑似违规已被系统折叠 隐藏此楼查看此楼

clear all;clc;

w1=80;l1=0.133;l3=0.849;l6=0.43;l61=0.828;l4=0.316;

for m=1:3601

o1(m)=pi*(m-1)/1800;o31(m)=atan((l6+l1*sin(o1(m)))/(l1*cos(o1(m))));

if o31(m)>=0

o3(m)=o31(m);

else o3(m)=pi+o31(m);

end;

s3(m)=(l1*cos(o1(m)))/cos(o3(m));o4(m)=pi-asin((l61-l3*sin(o3(m)))/l4);

se(m)=l3*cos(o3(m))+l4*cos(o4(m));

if o1(m)==pi/2

o3(m)=pi/2; s3(m)=l1+l6;

end

if o1(m)==3*pi/2

o3(m)=pi/2; s3(m)=l6-l1;

end

A1=[cos(o3(m)),-s3(m)*sin(o3(m)),0,0;sin(o3(m)),s3(m)*cos(o3(m)),0,0;0,-l3*sin(o3(m)),-l4*sin(o4(m)),-1;0,l3*cos(o3(m)),l4*cos(o4(m)),0];

B1=w1*[-l1*sin(o1(m));l1*cos(o1(m));0;0];D1=A1\B1;E1(:,m)=D1;ds(m)=D1(1);w3(m)=D1(2);w4(m)=D1(3);ve(m)=D1(4);

A2=[cos(o3(m)),-s3(m)*sin(o3(m)),0,0;sin(o3(m)),s3(m)*cos(o3(m)),0,0;0,-l3*sin(o3(m)),-l4*sin(o4(m)),-1;0,l3*cos(o3(m)),l4*cos(o4(m)),0];

B2=-[-w3(m)*sin(o3(m)),(-ds(m)*sin(o3(m))-s3(m)*w3(m)*cos(o3(m))),0,0;w3(m)*cos(o3(m)),(ds(m)*cos(o3(m))-s3(m)*w3(m)*sin(o3(m))),0,0;0,-l3*w3(m)*cos(o3(m)),-l4*w4(m)*cos(o4(m)),0;0,-l3*w3(m)*sin(o3(m)),-l4*w4(m)*sin(o4(m)),0]*[ds(m);w3(m);w4(m);ve(m)];

C2=w1*[-l1*w1*cos(o1(m));-l1*w1*sin(o1(m));0;0];B=B2+C2;D2=A2\B;E2(:,m)=D2;dds(m)=D2(1);a3(m)=D2(2);a4(m)=D2(3);ae(m)=D2(4);

end;

o11=o1*180/pi;y=[o3*180/pi;o4*60/pi];w=[w3;w4];a=[a3;a4];figure;

subplot(221);h1=plotyy(o11,y,o11, se); axis equal;

title('位置线图');xlabel('\it\theta1');ylabel('\it\theta3,\theta4,Se');

subplot(222);h2=plotyy(o11,w,o11,ve);

title('速度线图');

xlabel('\it\theta1');ylabel('\it\omega3,\omega4,Ve');

subplot(212);h3=plotyy(o11,a,o11,ae);

title('加速度线图');

xlabel('\it\theta1');ylabel('\it\alpha3,\alpha4,\alphaE');

F=[o11;o3./pi*180;o4./pi*180;se;w3;w4;ve;a3;a4;ae]';G=F(1:100:3601,:)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值