Density measurment using cumulative plots

1 回表示 (過去 30 日間)
Zuzana Pániková
Zuzana Pániková 2022 年 2 月 27 日
コメント済み: Zuzana Pániková 2022 年 3 月 5 日
I have two plots
plot(a,b)
hold on
plot(c,d)
and now i need do:

採用された回答

Image Analyst
Image Analyst 2022 年 2 月 27 日
Did you try trapz()?
  3 件のコメント
Zuzana Pániková
Zuzana Pániková 2022 年 3 月 1 日
the trapz() does not work.
this is my graph and i need to calculate:
Image Analyst
Image Analyst 2022 年 3 月 1 日
You forgot to attach the data and your code.

サインインしてコメントする。

その他の回答 (3 件)

Zuzana Pániková
Zuzana Pániková 2022 年 3 月 2 日
a =
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
b
b =
11
6
10
11
23
53
97
138
168
166
172
166
173
184
187
197
191
166
136
97
62
43
27
21
c
c =
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
d
d =
28
28
24
25
55
167
224
272
299
311
334
348
341
368
378
398
367
357
297
236
181
131
99
49
Fackov_po
Fackov_po =
0 11
1 6
2 10
3 11
4 23
5 53
6 97
7 138
8 168
9 166
10 172
11 166
12 173
13 184
14 187
15 197
16 191
17 166
18 136
19 97
20 62
21 43
22 27
23 21
trapz(b,Fackov_po)
ans =
-2006 160
It is correct?
  1 件のコメント
Image Analyst
Image Analyst 2022 年 3 月 2 日
I don't know. What are the two mat files and the xlsx file in the zip file? Which is yRed, yBlue, and the x values?

サインインしてコメントする。


Zuzana Pániková
Zuzana Pániková 2022 年 3 月 4 日
mat files and xlsx file you don't have to notice, I forgot to delete it.
yRed is d
yBlue is b
x values is a and c.it's the same.
I want to calculate the area between b and d.

Image Analyst
Image Analyst 2022 年 3 月 4 日
One way is to simply sum the curves and subtract them.
area = abs(sum(d) - sum(b));
That assumes there are no negative values, the curves don't cross, and treats the values like a bar chart (bars with flat tops). If you want to treat them like quadilaterals (like bars but slanted tops), you can use trapz().
  1 件のコメント
Zuzana Pániková
Zuzana Pániková 2022 年 3 月 5 日
Thank you for everthing

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeNumerical Integration and Differentiation についてさらに検索

製品


リリース

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by