I have this gaussian curve, and I am trying to find the area for one part of the peak. How would I go about calculating it? I've tried many methods, but they all do not seem to work (or they give me a 0 value). I appreciate any advise.

2 visualizaciones (últimos 30 días)
I have uploaded my x and y data. I want to find the area underneath the curve between x=1.8845 and x=2.1053. I would also like to find the area underneath x=2.1053 and x=2.2878. I would greatly appreciate any help.
  1 comentario
Trishal Zaveri
Trishal Zaveri el 10 de Mayo de 2018
I will just copy and paste the x and y data since the files are not clearly showing up. I apologize in advance for the data amount. xdata= 1.3778 1.3793 1.3809 1.3824 1.3839 1.3855 1.3870 1.3886 1.3901 1.3917 1.3933 1.3948 1.3964 1.3980 1.3996 1.4012 1.4027 1.4043 1.4059 1.4075 1.4091 1.4107 1.4123 1.4139 1.4155 1.4172 1.4188 1.4204 1.4220 1.4237 1.4253 1.4269 1.4286 1.4302 1.4319 1.4335 1.4352 1.4368 1.4385 1.4402 1.4419 1.4435 1.4452 1.4469 1.4486 1.4503 1.4520 1.4537 1.4554 1.4571 1.4588 1.4605 1.4622 1.4640 1.4657 1.4675 1.4692 1.4709 1.4727 1.4744 1.4762 1.4779 1.4797 1.4815 1.4832 1.4850 1.4868 1.4886 1.4904 1.4922 1.4939 1.4958 1.4976 1.4994 1.5012 1.5030 1.5048 1.5067 1.5085 1.5103 1.5122 1.5141 1.5159 1.5178 1.5196 1.5215 1.5234 1.5252 1.5271 1.5289 1.5308 1.5327 1.5346 1.5365 1.5385 1.5404 1.5423 1.5442 1.5461 1.5480 1.5500 1.5519 1.5539 1.5558 1.5578 1.5598 1.5617 1.5637 1.5656 1.5676 1.5696 1.5716 1.5736 1.5756 1.5776 1.5796 1.5817 1.5836 1.5857 1.5877 1.5897 1.5918 1.5938 1.5959 1.5979 1.6000 1.6020 1.6042 1.6062 1.6083 1.6104 1.6125 1.6146 1.6167 1.6188 1.6209 1.6230 1.6251 1.6273 1.6294 1.6316 1.6337 1.6359 1.6381 1.6402 1.6424 1.6446 1.6468 1.6489 1.6511 1.6534 1.6555 1.6577 1.6599 1.6622 1.6644 1.6667 1.6689 1.6712 1.6734 1.6757 1.6779 1.6802 1.6825 1.6847 1.6871 1.6894 1.6917 1.6940 1.6963 1.6986 1.7010 1.7033 1.7056 1.7080 1.7103 1.7127 1.7151 1.7174 1.7198 1.7222 1.7246 1.7270 1.7294 1.7318 1.7343 1.7367 1.7391 1.7416 1.7441 1.7464 1.7489 1.7514 1.7539 1.7564 1.7589 1.7614 1.7638 1.7664 1.7689 1.7714 1.7740 1.7765 1.7790 1.7816 1.7842 1.7867 1.7893 1.7919 1.7945 1.7971 1.7997 1.8024 1.8049 1.8076 1.8103 1.8128 1.8155 1.8181 1.8208 1.8236 1.8262 1.8289 1.8317 1.8343 1.8371 1.8397 1.8425 1.8452 1.8480 1.8507 1.8535 1.8562 1.8591 1.8618 1.8647 1.8674 1.8703 1.8731 1.8760 1.8788 1.8817 1.8845 1.8874 1.8903 1.8931 1.8961 1.8989 1.9019 1.9048 1.9077 1.9107 1.9136 1.9165 1.9195 1.9225 1.9254 1.9285 1.9315 1.9345 1.9375 1.9406 1.9436 1.9466 1.9496 1.9528 1.9558 1.9589 1.9620 1.9652 1.9683 1.9714 1.9745 1.9776 1.9809 1.9840 1.9872 1.9904 1.9935 1.9967 2.0001 2.0033 2.0065 2.0097 2.0130 2.0163 2.0195 2.0228 2.0261 2.0294 2.0327 2.0361 2.0395 2.0429 2.0463 2.0496 2.0530 2.0564 2.0598 2.0633 2.0667 2.0702 2.0736 2.0771 2.0805 2.0840 2.0875 2.0910 2.0946 2.0981 2.1017 2.1053 2.1089 2.1125 2.1161 2.1197 2.1232 2.1269 2.1306 2.1342 2.1380 2.1417 2.1454 2.1490 2.1528 2.1565 2.1603 2.1641 2.1678 2.1716 2.1754 2.1793 2.1832 2.1869 2.1908 2.1947 2.1987 2.2025 2.2064 2.2104 2.2142 2.2182 2.2222 2.2263 2.2302 2.2343 2.2383 2.2423 2.2464 2.2505 2.2545 2.2587 2.2627 2.2669 2.2711 2.2752 2.2794 2.2837 2.2878 2.2921 2.2962 2.3006 2.3049 2.3091 2.3135 2.3177 2.3221 2.3264 2.3308 2.3351 2.3396 2.3440 2.3485 2.3529 2.3574 2.3620 2.3664 2.3709 2.3755 2.3800 2.3846 2.3891 2.3939 2.3984 2.4031 2.4077 2.4125 2.4171 2.4218 2.4266 2.4313 2.4362 2.4409 2.4459 2.4506 2.4554 2.4604 2.4652 2.4700 2.4751 2.4800 2.4849 2.4900 2.4949 2.4999 2.5051 2.5101 2.5151 2.5204 2.5254 2.5305 2.5359 2.5410 2.5461 2.5515 2.5567 2.5620 2.5672 2.5727 2.5780 2.5833 2.5887 2.5942 2.5996 2.6050 2.6105 2.6161 2.6216 2.6271 2.6327 2.6382 2.6440 2.6496 2.6553 2.6609 2.6666 2.6723 2.6783 2.6840 2.6898 2.6956 2.7015 2.7074 2.7132 2.7194 2.7253 2.7313 2.7373 2.7434 2.7494 2.7555 2.7616 2.7678 2.7739 2.7804 2.7866 2.7929 2.7991 2.8055 2.8118 2.8182 2.8246 2.8310 2.8375 2.8440 2.8505 2.8571 2.8637 2.8703 2.8770 2.8837 2.8904 2.8971 2.9039 2.9108 2.9176 2.9245 2.9314 2.9384 2.9454 2.9524 2.9594 2.9665 2.9737 2.9808 2.9880 2.9953 3.0025 3.0098 3.0169 3.0243 3.0317 3.0392 3.0467 3.0542 3.0618 3.0694 3.0770 3.0847 3.0921 3.0999 3.1077 3.1156 3.1235 3.1314 3.1394 3.1471 3.1551 3.1632 3.1714 3.1796 3.1878 3.1957 3.2040 3.2124 3.2208 3.2293 3.2378 3.2460 3.2546 3.2632 3.2719 3.2803 3.2890 3.2979 3.3067 3.3157 3.3243 3.3333 3.3424 3.3515 3.3603 3.3695 3.3788 3.3881 3.3971 3.4066 3.4161 3.4256 3.4348 3.4445 3.4542 3.4636 3.4734 3.4832 3.4928 3.5028 3.5128 3.5229 3.5327 3.5429 y data:
0.0091
0.0091
0.0091
0.0087
0.0094
0.0093
0.0091
0.0089
0.0090
0.0090
0.0093
0.0091
0.0088
0.0087
0.0086
0.0089
0.0084
0.0085
0.0083
0.0082
0.0078
0.0078
0.0089
0.0080
0.0086
0.0089
0.0089
0.0085
0.0085
0.0087
0.0086
0.0092
0.0095
0.0087
0.0093
0.0098
0.0092
0.0090
0.0089
0.0077
0.0094
0.0090
0.0090
0.0100
0.0089
0.0076
0.0088
0.0083
0.0082
0.0085
0.0083
0.0089
0.0081
0.0087
0.0083
0.0084
0.0079
0.0088
0.0083
0.0083
0.0084
0.0084
0.0087
0.0081
0.0084
0.0085
0.0084
0.0089
0.0081
0.0081
0.0080
0.0080
0.0083
0.0085
0.0082
0.0082
0.0082
0.0082
0.0083
0.0080
0.0080
0.0083
0.0078
0.0087
0.0082
0.0082
0.0083
0.0085
0.0088
0.0081
0.0076
0.0085
0.0079
0.0084
0.0083
0.0088
0.0084
0.0083
0.0077
0.0088
0.0078
0.0081
0.0080
0.0085
0.0075
0.0089
0.0079
0.0083
0.0082
0.0081
0.0084
0.0082
0.0081
0.0089
0.0086
0.0080
0.0085
0.0081
0.0092
0.0082
0.0087
0.0089
0.0081
0.0084
0.0085
0.0081
0.0087
0.0077
0.0081
0.0085
0.0083
0.0087
0.0082
0.0087
0.0086
0.0084
0.0086
0.0084
0.0085
0.0091
0.0085
0.0082
0.0083
0.0090
0.0087
0.0087
0.0086
0.0085
0.0088
0.0087
0.0088
0.0091
0.0088
0.0091
0.0094
0.0088
0.0089
0.0089
0.0091
0.0093
0.0092
0.0094
0.0093
0.0093
0.0096
0.0097
0.0095
0.0098
0.0095
0.0098
0.0097
0.0098
0.0099
0.0101
0.0101
0.0103
0.0100
0.0105
0.0104
0.0102
0.0106
0.0106
0.0108
0.0108
0.0109
0.0109
0.0114
0.0113
0.0115
0.0117
0.0115
0.0120
0.0124
0.0121
0.0126
0.0127
0.0127
0.0132
0.0129
0.0129
0.0135
0.0139
0.0137
0.0142
0.0145
0.0148
0.0145
0.0152
0.0156
0.0163
0.0160
0.0163
0.0167
0.0171
0.0175
0.0175
0.0183
0.0186
0.0192
0.0195
0.0199
0.0207
0.0211
0.0214
0.0223
0.0230
0.0234
0.0241
0.0252
0.0256
0.0267
0.0273
0.0286
0.0295
0.0308
0.0320
0.0328
0.0346
0.0358
0.0375
0.0397
0.0418
0.0441
0.0466
0.0489
0.0522
0.0558
0.0593
0.0633
0.0680
0.0732
0.0802
0.0865
0.0927
0.1023
0.1125
0.1233
0.1348
0.1480
0.1617
0.1792
0.1968
0.2139
0.2343
0.2559
0.2828
0.3050
0.3271
0.3553
0.3850
0.4139
0.4426
0.4677
0.4940
0.5273
0.5588
0.5831
0.6110
0.6338
0.6615
0.6870
0.7050
0.7236
0.7403
0.7562
0.7681
0.7766
0.7826
0.7880
0.7906
0.7913
0.7904
0.7879
0.7817
0.7755
0.7705
0.7628
0.7557
0.7466
0.7367
0.7284
0.7195
0.7108
0.7030
0.6948
0.6880
0.6818
0.6754
0.6711
0.6675
0.6666
0.6660
0.6664
0.6685
0.6718
0.6767
0.6828
0.6899
0.6992
0.7091
0.7198
0.7304
0.7433
0.7554
0.7680
0.7781
0.7907
0.8031
0.8133
0.8248
0.8329
0.8414
0.8506
0.8567
0.8616
0.8648
0.8679
0.8692
0.8695
0.8681
0.8664
0.8634
0.8592
0.8544
0.8498
0.8448
0.8382
0.8325
0.8262
0.8206
0.8151
0.8088
0.8039
0.7996
0.7959
0.7929
0.7892
0.7869
0.7857
0.7864
0.7866
0.7876
0.7897
0.7926
0.7960
0.7996
0.8049
0.8109
0.8160
0.8211
0.8278
0.8339
0.8407
0.8474
0.8534
0.8596
0.8650
0.8724
0.8773
0.8825
0.8881
0.8929
0.8991
0.9041
0.9076
0.9126
0.9173
0.9221
0.9271
0.9312
0.9361
0.9421
0.9462
0.9520
0.9562
0.9609
0.9679
0.9749
0.9794
0.9863
0.9921
0.9996
1.0080
1.0144
1.0204
1.0278
1.0363
1.0448
1.0509
1.0568
1.0652
1.0738
1.0807
1.0857
1.0925
1.1008
1.1057
1.1112
1.1166
1.1222
1.1274
1.1333
1.1373
1.1412
1.1448
1.1483
1.1524
1.1551
1.1584
1.1602
1.1628
1.1646
1.1668
1.1685
1.1695
1.1707
1.1710
1.1722
1.1725
1.1731
1.1722
1.1710
1.1703
1.1691
1.1673
1.1663
1.1632
1.1610
1.1579
1.1546
1.1513
1.1469
1.1426
1.1381
1.1333
1.1288
1.1227
1.1168
1.1122
1.1059
1.0983
1.0933
1.0849
1.0783
1.0713
1.0641
1.0556
1.0478
1.0394
1.0314
1.0211
1.0127
1.0037
0.9953
0.9860
0.9760
0.9667
0.9562
0.9475
0.9388
0.9283
0.9180
0.9079
0.8986
0.8889
0.8778
0.8673
0.8571
0.8479
0.8390
0.8271
0.8169
0.8056
0.7959
0.7872
0.7756
0.7642
0.7533
0.7424
0.7343
0.7228
0.7117
0.7011
0.6907
0.6828
0.6723
0.6622
0.6518
0.6423
0.6340
0.6239
0.6137
0.6047
0.5956
0.5878
0.5788
0.5689
0.5598
0.5509
0.5433
0.5351
0.5248
0.5165
0.5080
0.5004
0.4929
0.4837
0.4754
0.4674
0.4605
0.4538
0.4459
0.4382
0.4313
0.4243
0.4192
0.4111
0.4039
0.3982
0.3924
0.3876
0.3808
0.3748
0.3697
0.3641
0.3599
0.3537
0.3477
0.3422
0.3376
0.3336

Iniciar sesión para comentar.

Respuestas (1)

John D'Errico
John D'Errico el 10 de Mayo de 2018
Editada: John D'Errico el 10 de Mayo de 2018
So, when I stop laughing, "I have this Gaussian curve..."
plot(x2,y2)
Yeah, right. In what universe is that a Gaussian curve? Or, perhaps are you thinking about Gauss's younger brother, Harvey Cornelius Rumpelstiltskin Gauss? He had very poor vision, so that might look vaguely like a Gaussian curve to him. You may have read about him, where he earned his fame in the field of textile manufacturing. ;-)
spl = pchip(x2,y2);
splint = fnint(spl);
diff(ppval(splint,[1.8845, 2.1053]))
ans =
0.10858092934252
FNINT lives in the curve fitting toolbox, I believe. If you don't have that, I have a viable replacement.

Categorías

Más información sobre Descriptive Statistics and Visualization en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by