从"fit"方程的拉普拉斯变换



这是我自己对上一个问题的后续:MATLAB 中数值数据的拉普拉斯变换


我已经通过实验收集了数据,并希望对其进行拉普拉斯变换。但是,laplace()需要一个模型/方程式。我找到了一个拟合方程来模拟我的数据:

[up,lo] = envelope(dat);
x = 1:length(up);
x = x';
f = fit(x,up,'poly3');

然后对于我的拉普拉斯变换,我需要传递输出

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类型变量,如果我正确理解其文档,则可以将其作为结构进行访问。这意味着您应该能够以编程方式使用拟合的参数来构建符号x函数。

最新更新