如何使用matlab cftool工具箱cftool得到cfit进行计算

Computer Solution of Engineering Problems
Main Navigation:
Personal Access
Matlab Curve Fitting and Interpolation
Polynomials
Interpolation
Curve Fitting
Fitting data to non-polynomial functions can be done with the nlinfit command.
nlinfit example: Save these functions ,
and run these commands. View the expfit2.m file to see how nlinfit is used. This example fits simulated experimental data to a curve of the form y=a*eb*x.
x=linspace(0,3,100);
y=expdata(x,a,b); % generate data with simulated noise via our function from above
[afit bfit] = expfit2(x,y) % fit data with our function from above
% Given an equation of the form x=A*sin(w*t+p)
% determine A, w, and p for this set of data.
% (Answer: A=5, w=1.42, p=1)
t=linspace(0,2*pi,50);
x=[5.13 2.63 4.85 4.09 4.49 6.35 3.60 2.22 3.33 2.29 1.18 1.52 0.32 -0.76 -2.24 ...
-2.45 -3.76 -3.90 -3.99 -4.52 -5.62 -5.48 -5.77 -3.50 -3.98 -3.96 -1.97 -2.28 ...
-0.50 1.42 1.78 1.62 2.48 5.15 3.78 4.72 5.09 5.84 5.19 5.19 4.85 6.63 4.33 ...
1.98 0.86 -0.38 1.98 -1.44 -0.61 -1.88];
If you have data that you want to draw a curve through, and the data doesn't have an associated equation, you can use the spline command. Here is an example.
% Spline curve
% A very simple example of using spline to draw a curve
% through a set of points
% this is NOT the same as a best fit curve,
% but it might be useful for a roller coaster!
x = 0:10; % simple set of x values
y = randi(20,size(x)); % random y values for each x value
xx = linspace(0,10,1000); % many x values for plotting
yy = spline(x,y,xx); % generate y values based on spline interpolation
plot(x,y,'ro'); % red data points
plot(xx,yy,'b-'); % blue spline curve
legend('data points','spline curve');
title('A spline is NOT a best fit curve');
Interactive Tools for Curve Fitting
References查看: 4838|回复: 5|关注: 0
cftool里怎么把拟合的公式输出到工作空间和拟合的图象里
<h1 style="color:# 麦片财富积分
新手, 积分 13, 距离下一级还需 37 积分
如题,还有 会什么拟合得到系数后面会有个括号,然后括号里还有两个数,括号里的数据是什么意思呀,谢谢指点,百度很多没有找到答案
<h1 style="color:# 麦片财富积分
花了一天时间 ,终于知道怎么提取系数了,用cftool拟合的结果一般保存在cfit格式的变量fitresult里,只要fitresult.a就可以提取出系数a,提取完系数后就可以把拟合的公式写在图象里
<h1 style="color:# 麦片财富积分
花了一天时间 ,终于知道怎么提取系数了,用cftool拟合的结果一般保存在cfit格式的变量fitresult里,只要fi ...
正解!多谢~
<h1 style="color:# 麦片财富积分
花了一天时间 ,终于知道怎么提取系数了,用cftool拟合的结果一般保存在cfit格式的变量fitresult里,只要fi ...
你好,这个是怎么提取结果的?可以详细说下嘛!
<h1 style="color:# 麦片财富积分
菜鸟还没看明白
<h1 style="color:# 麦片财富积分
然而并没有看懂:'(
站长推荐 /2
Powered by

我要回帖

更多关于 matlab cftool 导出 的文章

 

随机推荐