在Matlab中计算积分 [英] Calculate integral in Matlab

查看:74
本文介绍了在Matlab中计算积分的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我得到了以下数据:

我被要求计算Cp/T dT的积分,从113.7到264.4.

and I am asked to calculate the integral of Cp/T dT from 113.7 to 264.4.

我不确定应该如何解决.如果要使用积分命令,则需要一个函数,但是我不知道在这种情况下函数应该如何.

I am unsure of how I should solve this. If I want to use the integral command, I need a function, but I don't know how my function should be in that case.

我尝试过:

function func = Cp./T
T = [...]
Cp=[...]
end

但这没用.

推荐答案

使用MATLAB中的 cumtrapz 函数.

Use the cumtrapz function in MATLAB.

T = [...]
Cp=[...]
CpdivT = Cp./T
I = cumtrapz(T, CpdivT)

您可以在 https://www.mathworks上了解有关此功能的更多信息. .com/help/matlab/ref/cumtrapz.html

这篇关于在Matlab中计算积分的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆