フィルターのクリア

Area under curve (no function)

147 ビュー (過去 30 日間)
Rick
Rick 2014 年 9 月 9 日
コメント済み: Star Strider 2021 年 1 月 16 日
Hello,
If I have a set of data such as
X = [0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.85];
rA = [-.0053, -.0052, -.0050, -.0045, -.0040, -.0033, -.0025, -.0018, -.00125, -.0010];
plot(X,-1./rA)
and I want to know the area under the curve generated in the graph, how would I do that? There is no function involved here, this is just raw data, so I know I can't use quad or any of those integral functions.
Thanks
  3 件のコメント
Samarth Patil
Samarth Patil 2018 年 6 月 7 日
how to find the area in an interval for such a plot?
Krishnendu Mukherjee
Krishnendu Mukherjee 2018 年 9 月 12 日
Thanks a lot. It helped a lot.

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

採用された回答

Star Strider
Star Strider 2014 年 9 月 9 日
編集済み: Star Strider 2014 年 9 月 9 日
Use trapz. It’s designed to do exactly what you want.
Int = trapz(X, -1./rA)
produces:
Int =
306.7455
  5 件のコメント
Saurabh Parmar
Saurabh Parmar 2020 年 5 月 25 日
Thank You So Much! That helped a lot.
Star Strider
Star Strider 2021 年 1 月 16 日
Everyone — My pleasure!

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

その他の回答 (1 件)

Ashok
Ashok 2016 年 7 月 9 日
% Find the number of pixels of the connected component
Bin_image - logical binary image CC = bwconncomp(Bin_image); CC numPixels = cellfun(@numel,CC.PixelIdxList); disp(numPixels);
% Find the number of pixels of the connected component
[Label,~]=bwlabel((Bin_image),8); [Label,~]=bwlabel(Bin_log_4mult,8); num=1; [row, ~] = find(Label==num); Obj_area=numel(row); display(Obj_area);

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by