[英]Matlab:Sampling Curve into Frames and Plotting
我有以下特征的输出曲线
http://i.imgur.com/hABfsiC.jpg
以下是代表上述输出曲线的数据
0 1228.15406117455 1213.71796132282 1199.44623423626 1185.33715849069 1171.38902630825 1157.60014358826 1143.96882993237 1130.49341866405 1117.17225684288 1104.00370527364 1090.98613851046 1078.11794485629 1065.39752635781 1052.82329879590 1040.39369167202 1028.10714819050 1015.96212523702 1003.95709335331 992.090536708388 980.360953066379 968.766853751044 957.306763607236 945.979220959370 934.782777567031 923.715998577884 912.777462477973 901.965761039541 891.279499266498 880.717295337626 870.277780547640 859.959599246218 849.761408775075 839.681879403208 829.719694260385 819.873549268974 810.142153074209 800.524226972966 791.018504841132 781.623733059661 772.338670439371 763.162088144576 754.092769615612 745.129510490332 736.271118524637 727.516413512102 718.864227202765 710.313403221133 701.862796983477 693.511275614446 685.257717863085 677.101014018280 669.040065823703 661.073786392290 653.201100120311 645.420942601057 637.732260538220 630.134011658968 622.625164626790 615.204698954125 607.871604914830 600.624883456507 593.463546112736 586.386614915240 579.393122306018 572.482111049470 565.652634144552 558.903754736983 552.234546031533 545.644091204419 539.131483315831 532.695825222615 526.336229491134 520.051818310328 513.841723405001 507.705085949342 501.641056480713 495.648794813713 489.727469954538 483.876260015660 478.094352130827 472.380942370417 466.735235657145 461.156445682143 455.643794821435 450.196514052799 444.813842873049 439.495029215736 434.239329369281 429.046007895553 423.914337548901 418.843599195643 413.833081734033 408.882082014698 403.989904761570 399.155862493301 394.379275445192 389.659471491612 384.995786068946 380.387562099043 375.834149913207 371.334907176693 366.889198813755 362.496396933217 358.155880754588 353.867036534721 349.629257495012 345.441943749158 341.304502231452 337.216346625644 333.176897294352 329.185581209025 325.241831880470 321.345089289941 317.494799820775 313.690416190604 309.931397384121 306.217208586402 302.547321116805 298.921212363411 295.338365718043 291.798270511836 288.300421951372 284.844321055367 281.429474591926 278.055395016351 274.721600409499 271.427614416707 268.172966187255 264.957190314395 261.779826775920 258.640420875285 255.538523183269 252.473689480189 249.445480698649 246.453462866826 243.497207052304 240.576289306430 237.690290609210 234.838796814729 232.021398597103 229.237691396949 226.487275368383 223.769755326528 221.084740695544 218.431845457169 215.810688099765 213.220891567874 210.662083212278 208.133894740554 205.635962168130 203.167925769835 200.729430031931 198.320123604641 195.939659255160 193.587693821135 191.263888164634 188.967907126584 186.699419481673 184.458097893730 182.243618871551 180.055662725203 177.893913522768 175.758059047548 173.647790755713 171.562803734401 169.502796660248 167.467471758370 165.456534761766 163.469694871160 161.506664715267 159.567160311482 157.650901026989 155.757609540290 153.887011803139 152.038837002892 150.212817525260 148.408688917462 146.626189851781 144.865062089509 143.125050445289 141.405902751840 139.707369825069 138.029205429564 136.371166244459 134.733011829684 133.114504592569 131.515409754832 129.935495319916 128.374532040696 126.832293387534 125.308555516696 123.803097239110 122.315699989477 120.846147795722 119.394227248782 117.959727472736 116.542440095264 115.142159218437 113.758681389832 112.391805573974 111.041333124092 109.707067754198 108.388815511474 107.086384748976 105.799586098638 104.528232444585 103.272138896747 102.031122764767 100.805003532210 99.5936028310572 98.3967444164976 97.2142541419957 96.0459599346504 94.8916917708293 93.7512816520819 92.6245635813268 91.5113735393103 90.4115494613329 89.3249312142428 88.2513605736907 87.1906812016462 86.1427386241704 85.1073802094438 84.0844551460460 83.0738144214844 82.0753108009696 81.0887988064351 80.1141346957970 79.1511764424544 78.1997837150241 77.2598178573099 76.3311418685023 75.4136203836077 74.5071196541023 73.6115075288110 72.7266534350062 71.8524283597264 70.9887048313103 70.1353569011454 69.2922601256279 68.4592915483322 67.6363296823873 66.8232544930576 66.0199473805265 65.2262911628803 64.4421700592893 63.6674696733859 62.9020769768354 62.1458802930985 61.3987692813833 59.4883213755835 57.6483869118112 55.8755259367794 54.1665202384763 52.5183563982524 50.9282102384589 49.3934325474650 47.9115359739955 46.4801829919653 45.0971748454356 43.7604413910364 42.4680317622626 41.2181057864981 40.0089260915283 38.8388508436906 37.7063270647464 36.6098844790632 35.5481298468222 34.5197417427304 33.5234657431651 32.5581099878283 31.6225410848696 30.7156803310698 29.8365002210865 28.9840212219663 28.1573087911403 27.3554706179645 26.5776540705486 25.8230438311588 25.0908597048888 24.3803545875820 23.6908125801659 23.0215472376397 22.3718999419403 21.7412383888150 21.1289551796556 20.5344665100015 19.9572109471129 19.3966482896451 18.8522585030342 18.3235407247356 17.8100123339373 17.3112080808174 16.8266792708190 16.3559929997865 15.8987314361504 15.4544911466551 15.0228824624129 14.6035288823265 14.1960665111621 13.8001435297733 13.4154196951792 13.0415658683801 12.6782635679663 12.3252045477276 11.9820903966137 11.6486321595240 11.3245499775272 11.0095727462157 10.7034377910043 10.4058905582723 10.1166843213306 9.83557990027752 9.56234539487254 9.29675592962605 9.03859341036164 8.78764629156238 8.54370935386321 8.30658349109817 8.07607550635358 7.85199791651758 7.63416876485290 7.42241144115244 7.21655450906823 7.01643154023247 6.82188095481515 6.63274586818697 6.44887394337809 6.27011724904377 6.09633212266684 5.92737903874406 5.76312248171972 5.60343082344452 5.44817620495165 5.29723442235448 5.15048481668219 5.00781016748056 4.86909659001510 4.73423343592343 4.60311319717196 4.47563141318063 4.35168658098654 4.23118006832444 4.11401602950876 4.00010132400749 3.88934543760435 3.78166040605072 3.67696074111369 3.57516335893142 3.47618751059112 3.37995471484913 3.28638869291620 3.19541530523493 3.10696249017925 3.02096020460939 2.93734036621838 2.85603679760903 2.77698517204319 2.70012296080697 2.62538938213866 2.55272535166765 2.48207343431511 2.41337779760910 2.34658416636844 2.28163977871173 2.21849334334935 2.15709499811800 2.09739626971883 2.03935003462156 1.98291048109845 1.92803307235332 1.87467451071194 1.82279270284141 1.77234672596718 1.72329679505757 1.67560423094658 1.62923142936686 1.58414183086548 1.54029989157635 1.49767105482374 1.45622172353228 1.41591923341968 1.37673182694912 1.33862862801892 1.30157961736815 1.26555560867691 1.23052822534142 1.19646987790401 1.16335374211922 1.13115373763752 1.09984450728875 1.06940139694817 1.03980043596818 1.01101831815952 0.983032383306248 0.955820599199133 0.929361544172696 0.903634390131477 0.878618886051614 0.854295341944170 0.830644613267103 0.807648085773110 0.785287660780989 0.763545740858505 0.742405215905110 0.721849449623219 0.701862266367018 0.682427938358193 0.663531173258183 0.645157102086936 0.627291267478379 0.609919612263140 0.593028468369314 0.576604546032312 0.560634923305132 0.545107035860604 0.530008667077409 0.515327938401923 0.501053299978151 0.487173521538225 0.473677683546191 0.460555168587976 0.447795653000654 0.435389098734315 0.423325745440032 0.411596102777619 0.400190942937019 0.389101293367371 0.378318429707958 0.367833868915394 0.357639362581574 0.347726890437081 0.338088654034864 0.328717070609165 0.319604767104817 0.310744574372160 0.302129521522970 0.293752830442904 0.285607910456123 0.277688353137837 0.269987927270671 0.262500573940842 0.255220401770266 0.248141682280806 0.241258845386994 0.234566475013650 0.228059304834930 0.221732214131435 0.215580223762081 0.209598492247567 0.203782311962319 0.198127105431917 0.192628421733057 0.187281932993220 0.182083430987262 0.177028823828250 0.172114132749923 0.167335488978228 0.162689130689473 0.158171400052687 0.153778740353848 0.149507693199712 0.145354895799043 0.141317078319080 0.137391061315172 0.133573753231541 0.129862147971212 0.126253322533180 0.122744434714959 0.119332720878702 0.116015493779123 0.112790140451515 0.109654120158199 0.106604962391776 0.103640264933625 0.100757691966098 0.0979549722369389 0.0952298972744753 0.0925803196521720 0.0900041513011877 0.0874993618696001 0.0850639771270087 0.0826960774132594 0.0803937961300688 0.0781553182743600 0.0759788790121574 0.0738627622919147 0.0718052994961873 0.0698048681305858 0.0678598905489812 0.0659688327139552 0.0641302029915237 0.0623425509791821 0.0606044663663534 0.0589145778263389 0.0572715519389033 0.0556740921426450 0.0541209377163267 0.0526108627883675 0.0511426753737151
以下函数表示在50分钟的时间间隔内Tracer的输出特性(Y轴-Mbq和X轴:以分钟为单位的时间)
现在我想将输出曲线采样为19帧
4 frames : Each of 15 seconds time interval
2 frames : Each of 30 seconds time interval
2 frames : Each of 60 seconds time interval
11 frames : Each of 200 seconds time interval
并在图表中绘制各个框架,请向我建议一些解决此问题的方法
如果我理解正确,那么对应的x值时间为0到50分钟,因此,由于您有500个样本,因此每分钟有10个样本,或者样本之间的间隔为6秒。
要获得不同速率的样本,可以使用interp1
内插信号。 如果您上面给出的信号存储在Y
,则可以使用以下命令将其插值到15秒间隔:
x = 0:6:3000; % The original sample time, in seconds
xi = 0:15:3000; % The interpolated sample time, in seconds
Yi = interp1(x, Y, xi);
您可以内插到原始数据中的任何指定x值,因此对于不同的采样率,您可以定义:
xi = [0:15:60, 90:30:120, 180:60:240, 440:200:2240];
在MATLAB中绘制曲线通常是使用plot
函数完成的。 对于插值数据,可以使用:
figure;
plot(xi / 60, Yi);
xlabel('Time [min]');
ylabel('Signal [units]');
title('My signal');
请注意,该图的时间单位是如何从秒更改为分钟的。 此处给出的其余命令对绘制也很有用。 figure
创建一个新的图窗口,并使用xlabel
, ylabel
和title
对其进行注释。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.