这是我自己先前一个问题的跟进:MATLAB中数值数据的拉普拉斯变换
我已经实验性地收集了数据,并希望对此进行Laplace转换。但是,laplace()
需要一个模型/方程。我找到一个拟合方程来对数据建模:
[up,lo] = envelope(dat);
x = 1:length(up);
x = x';
f = fit(x,up,'poly3');
然后对于我的Laplace变换,我需要传递
f = fit(x,up,'poly3');
进入
syms f
laplace(f)
但是目前,这会引发以下转换f
:
laplace(f)
ans =
1/s^2
如果这是 f
f =
Linear model Poly3:
f(x) = p1*x^3 + p2*x^2 + p3*x + p4
Coefficients (with 95% confidence bounds):
p1 = 1.772e-12 (1.593e-12, 1.951e-12)
p2 = -2.211e-08 (-2.483e-08, -1.939e-08)
p3 = 2.847e-05 (1.676e-05, 4.017e-05)
p4 = 0.2762 (0.2627, 0.2897)
如何找到的拉普拉斯变换f
?
我对的输出不熟悉fit
,但您的符号变量至少应为x
,因为这是您的因变量。然后,您可以f
自己建立:
p1 = 1.772e-12;
p2 = -2.211e-08;
p3 = 2.847e-05;
p4 = 0.2762;
syms x
f = p1*x.^3 + p2*x.^2 + p3*x + p4;
laplace(f)
ans =
(8402860860456175*((50949907131585781563392*s)/5251788037785109375 + 1))/(295147905179352825856*s^2) - 6682337467919863/(151115727451828646838272*s^3) + 26323556995364325/(2475880078570760549798248448*s^4)
fit()
给您一个fitobject
类型变量,如果我正确理解其文档,可以将其作为结构进行访问。这意味着您应该能够以编程方式使用拟合的参数来构建symbolic函数x
。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句