MATLAB 两组数据:T =Columns 1 through 13 33.9000 38.9000 43.9000 48.9000 53.9000 58.9000 63.9000 68.9000 73.9000 78.9000 81.6000 81.8000 81.9000Columns 14 through 26 82.0000 82.1000 82.2000 82.2000 82.3000 82.4000 82.5000 82.5000 82.6000 82.7000
来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/22 17:04:34
MATLAB 两组数据:T =Columns 1 through 13 33.9000 38.9000 43.9000 48.9000 53.9000 58.9000 63.9000 68.9000 73.9000 78.9000 81.6000 81.8000 81.9000Columns 14 through 26 82.0000 82.1000 82.2000 82.2000 82.3000 82.4000 82.5000 82.5000 82.6000 82.7000
MATLAB
两组数据:
T =
Columns 1 through 13
33.9000 38.9000 43.9000 48.9000 53.9000 58.9000 63.9000 68.9000 73.9000 78.9000 81.6000 81.8000 81.9000
Columns 14 through 26
82.0000 82.1000 82.2000 82.2000 82.3000 82.4000 82.5000 82.5000 82.6000 82.7000 82.8000 82.9000 83.0000
Columns 27 through 39
83.2000 83.2000 83.5000 83.5000 83.4000 83.5000 83.5000 83.5000 83.5000 83.5000 83.5000 83.5000 83.6000
Columns 40 through 50
83.7000 83.9000 84.1000 84.3000 84.3000 84.5000 84.6000 84.8000 84.9000 85.0000 85.3000
Ucd =
Columns 1 through 13
0.0569 0.0569 0.0568 0.0567 0.0566 0.0566 0.0565 0.0564 0.0555 0.0550 0.0545 0.0535 0.0528
Columns 14 through 26
0.0520 0.0522 0.0500 0.0490 0.0477 0.0465 0.0449 0.0435 0.0420 0.0400 0.0385 0.0370 0.0360
Columns 27 through 39
0.0345 0.0335 0.0326 0.0317 0.0301 0.0294 0.0309 0.0287 0.0281 0.0224 0.0266 0.0255 0.0245
Columns 40 through 50
0.0235 0.0227 0.0222 0.0215 0.0268 0.0200 0.0195 0.0190 0.0183 0.0177 0.0167
用plot(T,Ucd)作图后,欲求其图像上斜率最大的点的斜率值,
能不能给出具体过程?
MATLAB 两组数据:T =Columns 1 through 13 33.9000 38.9000 43.9000 48.9000 53.9000 58.9000 63.9000 68.9000 73.9000 78.9000 81.6000 81.8000 81.9000Columns 14 through 26 82.0000 82.1000 82.2000 82.2000 82.3000 82.4000 82.5000 82.5000 82.6000 82.7000
斜率k=dy/dx=Δy/Δx
所以,
clc;clear
T=[33.9000 38.9000 43.9000 48.9000 53.9000 58.9000 63.9000 68.9000 73.9000 78.9000 81.6000 81.8000 81.9000...
82.0000 82.1000 82.2000 82.2000 82.3000 82.4000 82.5000 82.5000 82.6000 82.7000 82.8000 82.9000 83.0000...
83.2000 83.2000 83.5000 83.5000 83.4000 83.5000 83.5000 83.5000 83.5000 83.5000 83.5000 83.5000 83.6000...
83.7000 83.9000 84.1000 84.3000 84.3000 84.5000 84.6000 84.8000 84.9000 85.0000 85.3000];
Ucd =[0.0569 0.0569 0.0568 0.0567 0.0566 0.0566 0.0565 0.0564 0.0555 0.0550 0.0545 0.0535 0.0528...
0.0520 0.0522 0.0500 0.0490 0.0477 0.0465 0.0449 0.0435 0.0420 0.0400 0.0385 0.0370 0.0360...
0.0345 0.0335 0.0326 0.0317 0.0301 0.0294 0.0309 0.0287 0.0281 0.0224 0.0266 0.0255 0.0245...
0.0235 0.0227 0.0222 0.0215 0.0268 0.0200 0.0195 0.0190 0.0183 0.0177 0.0167];
%sp=spline(T,Ucd)
plot(T,Ucd)
for i=1:length(T)-1
k(i)=(Ucd(i+1)-Ucd(i))/(T(i+1)-T(i));
end
k
[maxk I]=max(k)
由于分母T的间隔太小,导致为零,可以移动平均或平滑处理数据.
运行结果:
k =
Columns 1 through 12
0 -0.0000 -0.0000 -0.0000 0 -0.0000 -0.0000 -0.0002 -0.0001 -0.0002 -0.0050 -0.0070
Columns 13 through 24
-0.0080 0.0020 -0.0220 -Inf -0.0130 -0.0120 -0.0160 -Inf -0.0150 -0.0200 -0.0150 -0.0150
Columns 25 through 36
-0.0100 -0.0075 -Inf -0.0030 -Inf 0.0160 -0.0070 Inf -Inf -Inf -Inf Inf
Columns 37 through 48
-Inf -0.0100 -0.0100 -0.0040 -0.0025 -0.0035 Inf -0.0340 -0.0050 -0.0025 -0.0070 -0.0060
Column 49
-0.0033
maxk =
Inf
I =
32
1.6