matlab出图的问题,程序如下:% % clear close all clcN = 200.0000000000; %输入离散点的数目t = 0:1:N; t = t*360/N;K=1.5;H=800;%行程速比等于1.5,工作行程H为800Xita=180*(K-1)/(K+1);%求极位夹角L_4=H/(2*sind
来源:学生作业帮助网 编辑:作业帮 时间:2024/06/29 02:38:46
![matlab出图的问题,程序如下:% % clear close all clcN = 200.0000000000; %输入离散点的数目t = 0:1:N; t = t*360/N;K=1.5;H=800;%行程速比等于1.5,工作行程H为800Xita=180*(K-1)/(K+1);%求极位夹角L_4=H/(2*sind](/uploads/image/z/691937-17-7.jpg?t=matlab%E5%87%BA%E5%9B%BE%E7%9A%84%E9%97%AE%E9%A2%98%2C%E7%A8%8B%E5%BA%8F%E5%A6%82%E4%B8%8B%EF%BC%9A%25+++++++++%25+clear+close+all+clcN+%3D+200.0000000000%3B++++++++++%25%E8%BE%93%E5%85%A5%E7%A6%BB%E6%95%A3%E7%82%B9%E7%9A%84%E6%95%B0%E7%9B%AEt+%3D+0%3A1%3AN%3B++t+%3D+t%2A360%2FN%3BK%3D1.5%3BH%3D800%3B%25%E8%A1%8C%E7%A8%8B%E9%80%9F%E6%AF%94%E7%AD%89%E4%BA%8E1.5%2C%E5%B7%A5%E4%BD%9C%E8%A1%8C%E7%A8%8BH%E4%B8%BA800Xita%3D180%2A%28K-1%29%2F%28K%2B1%29%3B%25%E6%B1%82%E6%9E%81%E4%BD%8D%E5%A4%B9%E8%A7%92L_4%3DH%2F%282%2Asind)
matlab出图的问题,程序如下:% % clear close all clcN = 200.0000000000; %输入离散点的数目t = 0:1:N; t = t*360/N;K=1.5;H=800;%行程速比等于1.5,工作行程H为800Xita=180*(K-1)/(K+1);%求极位夹角L_4=H/(2*sind
matlab出图的问题,程序如下:
%
%
clear
close all
clc
N = 200.0000000000; %输入离散点的数目
t = 0:1:N; t = t*360/N;
K=1.5;H=800;%行程速比等于1.5,工作行程H为800
Xita=180*(K-1)/(K+1);%求极位夹角
L_4=H/(2*sind(Xita/2));%求4杆的长度
L_o1o2=400;%机架的长度
L_2=L_o1o2*sind(Xita/2);%求2杆的长度
for i=1:N+1
b = 360/N*(i-1);
B_x = L_2*cosd(b);
B_y = L_2*sind(b);
Gama(i) = atan(B_x/(B_y + L_o1o2));
Gama(i) = 90 - Gama(i)/pi*180;
end
clear b; clear B_x; clear B_y;
s = L_4*cosd(Gama);%求位移
v=diff(s);%求速度
a=diff(s,2)%求加速度
subplot(2,2,1);
plot(t,Gama);
subplot(2,2,2);
plot(t,s);
subplot(2,2,3);
plot(t,v);
subplot(2,2,4);
plot(t,a);
第三个和第四个图出不来,给的提示是
matlab出图的问题,程序如下:% % clear close all clcN = 200.0000000000; %输入离散点的数目t = 0:1:N; t = t*360/N;K=1.5;H=800;%行程速比等于1.5,工作行程H为800Xita=180*(K-1)/(K+1);%求极位夹角L_4=H/(2*sind
在命令窗口输入,查看diff具体说明
>> help diff
diff Difference and approximate derivative.
diff(X),for a vector X,is [X(2)-X(1) X(3)-X(2) ...X(n)-X(n-1)].
因此你这里求的速度值v的维数要比s维数小1.
注意:画图的时候x轴和y轴的点数必须一致.
因为不可能在第一个时间点就求出速度,所以我建议修改后的时间轴为:
t1=t(2:length(t));
你求的加速度a的维数比s维数小2,因此也要做相应的x轴时间轴的调整.
因为不可能在第1,2个时间点求出加速度,所以我建议修改后的时间轴为:
t2=t(3:length(t));
程序如下:
%
%
clear
close all
clc
N = 200.0000000000; %输入离散点的数目
t = 0:1:N; t = t*360/N;
K=1.5;H=800;%行程速比等于1.5,工作行程H为800
Xita=180*(K-1)/(K+1);%求极位夹角
L_4=H/(2*sind(Xita/2));%求4杆的长度
L_o1o2=400;%机架的长度
L_2=L_o1o2*sind(Xita/2);%求2杆的长度
for i=1:N+1
b = 360/N*(i-1);
B_x = L_2*cosd(b);
B_y = L_2*sind(b);
Gama(i) = atan(B_x/(B_y + L_o1o2));
Gama(i) = 90 - Gama(i)/pi*180;
end
clear b; clear B_x; clear B_y;
s = L_4*cosd(Gama);%求位移
v=diff(s);%求速度
a=diff(s,2)%求加速度
t1=t(2:length(t));
t2=t(3:length(t));
subplot(2,2,1);
plot(t,Gama);
subplot(2,2,2);
plot(t,s);
subplot(2,2,3);
plot(t1,v);
subplot(2,2,4);
plot(t2,a);