[已解决] 怎么在matlab从图形中有规律批量提取数据

[复制链接]
www520xss 发表于 2021-10-12 17:25:03
我的原始数据是一个横坐标为周期的加速度反应谱:
我将其转换为横坐标为频率后得到的数据如下
我想在横坐标为频率的图形中,从0.25开始每间隔0.1提取一个数据,并输出,想问大神们怎么操作啊?
50
27.47174
33.33333333
27.86805
25
28.53863
20
29.76979
16.66666667
31.5801
14.28571429
35.94951
12.5
41.85791
11.11111111
49.90848
10
51.64008
9.090909091
52.28659
8.333333333
57.50613
7.692307692
58.48569
7.142857143
63.58708
6.666666667
64.95167
6.25
66.10755
5.882352941
65.7246
5.555555556
72.7491
5.263157895
78.47702
5
84.6963
4.761904762
87.26104
4.545454545
84.65924
4.347826087
81.35989
4.166666667
78.04234
4
75.99577
3.846153846
75.19863
3.703703704
75.60055
3.571428571
76.94741
3.448275862
75.50068
3.333333333
74.27636
3.225806452
74.67498
3.125
74.15564
3.03030303
73.92218
2.941176471
73.2678
2.857142857
71.48849
2.777777778
68.98801
2.702702703
65.64371
2.631578947
61.71103
2.564102564
58.42554
2.5
55.23888
2.43902439
53.98996
2.380952381
52.84634
2.325581395
51.3087
2.272727273
50.38961
2.222222222
49.4537
2.173913043
48.11223
2.127659574
46.21871
2.083333333
44.34049
2.040816327
42.48502
2
40.78769
1.960784314
39.33848
1.923076923
37.89032
1.886792453
36.40734
1.851851852
35.70107
1.818181818
35.25959
1.785714286
34.91625
1.754385965
34.44201
1.724137931
33.85904
1.694915254
33.06339
1.666666667
32.26448
1.639344262
31.7609
1.612903226
31.12756
1.587301587
30.24886
1.5625
29.23829
1.538461538
28.08389
1.515151515
27.04441
1.492537313
26.0015
1.470588235
24.99194
1.449275362
23.91517
1.428571429
22.8982
1.408450704
22.02857
1.388888889
21.26679
1.369863014
20.56119
1.351351351
19.91807
1.333333333
19.31613
1.315789474
18.7722
1.298701299
18.34205
1.282051282
18.03986
1.265822785
17.93734
1.25
17.79753
1.234567901
17.62594
1.219512195
17.35971
1.204819277
17.04808
1.19047619
16.69504
1.176470588
16.35543
1.162790698
16.0657
1.149425287
15.75294
1.136363636
15.38833
1.123595506
15.13123
1.111111111
14.91982
1.098901099
14.68277
1.086956522
14.48622
1.075268817
14.32201
1.063829787
14.13891
1.052631579
13.8286
1.041666667
13.43766
1.030927835
13.02789
1.020408163
12.68812
1.01010101
12.32356
1
11.94318
0.99009901
11.5832
0.980392157
11.25068
0.970873786
10.97474
0.961538462
10.71087
0.952380952
10.45799
0.943396226
10.21583
0.934579439
9.993085
0.925925926
9.771891
0.917431193
9.566744
0.909090909
9.418276
0.900900901
9.295321
0.892857143
9.165124
0.884955752
9.005535
0.877192982
8.823653
0.869565217
8.618532
0.862068966
8.415841
0.854700855
8.210088
0.847457627
8.002638
0.840336134
7.810335
0.833333333
7.616103
0.826446281
7.420624
0.819672131
7.230135
0.81300813
7.122859
0.806451613
7.028915
0.8
6.939015
0.793650794
6.842988
0.787401575
6.7398
0.78125
6.627291
0.775193798
6.504132
0.769230769
6.379624
0.763358779
6.260556
0.757575758
6.144962
0.751879699
6.091626
0.746268657
6.039606
0.740740741
5.979397
0.735294118
5.904853
0.729927007
5.809109
0.724637681
5.712376
0.71942446
5.604103
0.714285714
5.506215
0.709219858
5.413959
0.704225352
5.317412
0.699300699
5.222876
0.694444444
5.131735
0.689655172
5.051182
0.684931507
4.977788
0.680272109
4.908818
0.675675676
4.841312
0.67114094
4.783568
0.666666667
4.728494
0.662251656
4.670524
0.657894737
4.607426
0.653594771
4.552903
0.649350649
4.499256
0.64516129
4.440132
0.641025641
4.380262
0.636942675
4.314418
0.632911392
4.241332
0.628930818
4.173929
0.625
4.130426
0.621118012
4.090741
0.617283951
4.049259
0.613496933
4.005526
0.609756098
3.957494
0.606060606
3.906779
0.602409639
3.853241
0.598802395
3.798144
0.595238095
3.751662
0.591715976
3.705326
0.588235294
3.657459
0.584795322
3.607568
0.581395349
3.556259
0.578034682
3.504565
0.574712644
3.452685
0.571428571
3.401053
0.568181818
3.350071
0.564971751
3.305388
0.561797753
3.262797
0.558659218
3.222838
0.555555556
3.182126
0.552486188
3.140876
0.549450549
3.099332
0.546448087
3.057368
0.543478261
3.015912
0.540540541
2.975041
0.537634409
2.935379
0.534759358
2.896418
0.531914894
2.857221
0.529100529
2.817635
0.526315789
2.777591
0.523560209
2.738971
0.520833333
2.709853
0.518134715
2.6832
0.515463918
2.656694
0.512820513
2.630321
0.510204082
2.605459
0.507614213
2.579738
0.505050505
2.554979
0.502512563
2.530038
0.5
2.503997
0.497512438
2.476838
0.495049505
2.449306
0.492610837
2.422153
0.490196078
2.399076
0.487804878
2.377826
0.485436893
2.357503
0.483091787
2.338165
0.480769231
2.319535
0.4784689
2.300274
0.476190476
2.2805
0.473933649
2.26065
0.471698113
2.240341
0.469483568
2.219515
0.46728972
2.200274
0.465116279
2.181503
0.462962963
2.162171
0.460829493
2.142047
0.458715596
2.123544
0.456621005
2.106268
0.454545455
2.088353
0.452488688
2.070453
0.45045045
2.054471
0.448430493
2.038053
0.446428571
2.021306
0.444444444
2.004356
0.442477876
1.9882
0.440528634
1.972547
0.438596491
1.956441
0.436681223
1.939721
0.434782609
1.922353
0.432900433
1.904462
0.431034483
1.886894
0.429184549
1.869406
0.427350427
1.851426
0.425531915
1.833062
0.423728814
1.814253
0.421940928
1.794944
0.420168067
1.775379
0.418410042
1.755532
0.416666667
1.735491
0.414937759
1.715385
0.41322314
1.696529
0.411522634
1.677635
0.409836066
1.659412
0.408163265
1.641326
0.406504065
1.626326
0.4048583
1.6135
0.403225806
1.600779
0.401606426
1.588118
0.4
1.575491
0.398406375
1.563362
0.396825397
1.551303
0.395256917
1.539465
0.393700787
1.528459
0.392156863
1.518556
0.390625
1.509862
0.389105058
1.501162
0.387596899
1.492718
0.386100386
1.484053
0.384615385
1.475176
0.383141762
1.466138
0.381679389
1.456894
0.380228137
1.447915
0.378787879
1.438862
0.377358491
1.4297
0.37593985
1.4206
0.374531835
1.412297
0.373134328
1.403876
0.371747212
1.395456
0.37037037
1.387968
0.36900369
1.380456
0.367647059
1.373474
0.366300366
1.366559
0.364963504
1.359568
0.363636364
1.352535
0.362318841
1.345582
0.36101083
1.3389
0.35971223
1.332115
0.358422939
1.325226
0.357142857
1.318232
0.355871886
1.311265
0.354609929
1.304562
0.35335689
1.298568
0.352112676
1.2925
0.350877193
1.286371
0.34965035
1.280218
0.348432056
1.274103
0.347222222
1.267965
0.346020761
1.261771
0.344827586
1.255547
0.343642612
1.249429
0.342465753
1.243229
0.341296928
1.236888
0.340136054
1.230462
0.338983051
1.223935
0.337837838
1.217332
0.336700337
1.210665
0.33557047
1.203985
0.334448161
1.198068
0.333333333
1.192306
0.332225914
1.186494
0.331125828
1.180788
0.330033003
1.175491
0.328947368
1.170203
0.327868852
1.164924
0.326797386
1.159647
0.325732899
1.154556
0.324675325
1.149503
0.323624595
1.144479
0.322580645
1.139485
0.321543408
1.134526
0.320512821
1.129591
0.319488818
1.124762
0.318471338
1.119924
0.317460317
1.115256
0.316455696
1.110726
0.315457413
1.106179
0.314465409
1.101612
0.313479624
1.097029
0.3125
1.092412
0.31152648
1.087859
0.310559006
1.083435
0.309597523
1.079182
0.308641975
1.074897
0.307692308
1.070771
0.306748466
1.067074
0.305810398
1.063606
0.304878049
1.060068
0.303951368
1.056538
0.303030303
1.052956
0.302114804
1.049362
0.301204819
1.045935
0.3003003
1.042776
0.299401198
1.039676
0.298507463
1.036588
0.297619048
1.033462
0.296735905
1.0303
0.295857988
1.027094
0.294985251
1.023844
0.294117647
1.020559
0.293255132
1.017226
0.292397661
1.01385
0.29154519
1.010426
0.290697674
1.006938
0.289855072
1.0034
0.289017341
0.999824
0.288184438
0.996206
0.287356322
0.992588
0.286532951
0.989079
0.285714286
0.985556
0.284900285
0.982024
0.284090909
0.978685
0.283286119
0.975303
0.282485876
0.971882
0.281690141
0.968403
0.280898876
0.964921
0.280112045
0.961385
0.279329609
0.957862
0.278551532
0.954324
0.277777778
0.950815
0.27700831
0.947368
0.276243094
0.944379
0.275482094
0.941412
0.274725275
0.938435
0.273972603
0.935432
0.273224044
0.932453
0.272479564
0.929438
0.27173913
0.926435
0.27100271
0.923426
0.27027027
0.920629
0.269541779
0.917788
0.268817204
0.914988
0.268096515
0.912171
0.267379679
0.909365
0.266666667
0.906509
0.265957447
0.903721
0.265251989
0.900965
0.264550265
0.898235
0.263852243
0.895524
0.263157895
0.8928
0.262467192
0.890091
0.261780105
0.887379
0.261096606
0.884862
0.260416667
0.882479
0.25974026
0.880368
0.259067358
0.878294
0.258397933
0.876168
0.257731959
0.874015
0.257069409
0.871818
0.256410256
0.869579
0.255754476
0.867312
0.255102041
0.864994
0.254452926
0.862706
0.253807107
0.860432
0.253164557
0.858297
0.252525253
0.856197
0.251889169
0.854074
0.251256281
0.851921
0.250626566
0.849815
0.25
0.847682


最佳答案


15631202458 发表于 2021-10-13 09:43:43
x=第一列数据;
y=第二列数据:

yy是用样条插值求得的结果,还可以选用其他的方法,自己help interp1试下。
  1. xx=0.25:0.1:max(x);
  2. yy = interp1(x,y,xx,'spline');
  3. plot(x,y,'ro',xx,yy,'b.')
复制代码


[attach]325653[/attach]
回复此楼

1 条回复


15631202458 发表于 2021-10-13 09:43:43
x=第一列数据;
y=第二列数据:

yy是用样条插值求得的结果,还可以选用其他的方法,自己help interp1试下。
  1. xx=0.25:0.1:max(x);
  2. yy = interp1(x,y,xx,'spline');
  3. plot(x,y,'ro',xx,yy,'b.')
复制代码


untitled.jpg
回复此楼
您需要登录后才可以回帖 登录 | 注册

本版积分规则

相关帖子
热门教程
站长推荐
快速回复 返回顶部 返回列表