integrating equations obtained from polyfit
显示 更早的评论
Hello,
I have an equation to integrate:
exp(thata(x)-1)*y_f(x)
But I used polyfit to get the theta and the y_f, so i have two vectors. but I want the equation version of the fit, so that I can put it on the integral equation. how can i use those two vectors to be able to compute that integral?
If someone knows how to do this, I'd appreciate the help!
thank you
采纳的回答
更多回答(1 个)
Mischa Kim
2014-1-14
编辑:Mischa Kim
2014-1-14
trapz(x, exp(theta_x - 1).*y_fx)
where theta_x and y_fx are your two vectors.
2 个评论
davood
2014-1-15
Mischa Kim
2014-1-15
OK, but that's really a different question from the one you asked. In general, there is no way to "come up" with a reliable symbolic equation based on numeric data points. And you need a symbolic equation to be able to evaluate it at a certain x_star value.
类别
在 帮助中心 和 File Exchange 中查找有关 Calculus 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!