How to integrate a data set?

19 ビュー (過去 30 日間)
Chuqi Zheng
Chuqi Zheng 2020 年 2 月 16 日
コメント済み: Star Strider 2020 年 2 月 16 日
I have a data set that includes data for temperature and specific heat capacity, and I need to integrate (Cv(T)/T)dT and (Cv(T))dT over 0 to 270. I uploaded the data into Matlab already, and I have a plot of the data (temp on x-axis, Cv on y-axis). How do I code for the cumulative entropy (see first equation) and energy (see second equation)?

採用された回答

Star Strider
Star Strider 2020 年 2 月 16 日
I would use the trapz function, or cumtrapz (linked to in the trapz documentation), depending on the result you want.
For example:
IntEq1 = trapz(T, Cv./T);
IntEq2 = trapz(T,Cv);
Without your data I am only guessing here, however these should at least be close to what you want. If you want vectors of interim results as well, replace trapz with cumtrapz in these assignments.
  12 件のコメント
Chuqi Zheng
Chuqi Zheng 2020 年 2 月 16 日
Got it! Thanks again for all your help. I really appreciate it.
Star Strider
Star Strider 2020 年 2 月 16 日
As always, my pleasure!

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

その他の回答 (0 件)

カテゴリ

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