给出数据后,如何用matlab拟合成椭圆或双曲线啊啊大悬赏!!!
XY14.71.149614.751.182214.81.215314.851.249114.91.283214.951.318151.353415.051.389415...
X Y
14.7
1.1496
14.75
1.1822
14.8
1.2153
14.85
1.2491
14.9
1.2832
14.95
1.318
15
1.3534
15.05
1.3894
15.1
1.4262
15.15
1.4634
15.2
1.5015
15.25
1.5402
15.3
1.5799
15.35
1.6201
15.4
1.6613
15.45
1.7033
15.5
1.7462
15.55
1.7901
15.6
1.835
15.65
1.8809
15.7
1.9279
X,Y两列坐标如上,求大神拟合后给出解析式和matlab程序
X=[14.7000 14.7500 14.8000 14.8500 14.9000 14.9500 15.0000 15.0500 15.1000 15.1500 15.2000 15.2500 15.3000 15.3500 15.4000 15.4500 15.5000 15.5500 15.6000 15.6500 15.7000];
Y=[ 1.1496 1.1822 1.2153 1.2491 1.2832 1.3180 1.3534 1.3894 1.4262 1.4634 1.5015 1.5402 1.5799 1.6201 1.6613 1.7033 1.7462 1.7901 1.8350 1.8809 1.9279] 展开
14.7
1.1496
14.75
1.1822
14.8
1.2153
14.85
1.2491
14.9
1.2832
14.95
1.318
15
1.3534
15.05
1.3894
15.1
1.4262
15.15
1.4634
15.2
1.5015
15.25
1.5402
15.3
1.5799
15.35
1.6201
15.4
1.6613
15.45
1.7033
15.5
1.7462
15.55
1.7901
15.6
1.835
15.65
1.8809
15.7
1.9279
X,Y两列坐标如上,求大神拟合后给出解析式和matlab程序
X=[14.7000 14.7500 14.8000 14.8500 14.9000 14.9500 15.0000 15.0500 15.1000 15.1500 15.2000 15.2500 15.3000 15.3500 15.4000 15.4500 15.5000 15.5500 15.6000 15.6500 15.7000];
Y=[ 1.1496 1.1822 1.2153 1.2491 1.2832 1.3180 1.3534 1.3894 1.4262 1.4634 1.5015 1.5402 1.5799 1.6201 1.6613 1.7033 1.7462 1.7901 1.8350 1.8809 1.9279] 展开
1个回答
展开全部
clear,clc
x1 = [14.7000 14.7500 14.8000 14.8500 14.9000 14.9500 15.0000 15.0500 15.1000 15.1500 15.2000 15.2500 15.3000 15.3500 15.4000 15.4500 15.5000 15.5500 15.6000 15.6500 15.7000];
y1 = [1.1496 1.1822 1.2153 1.2491 1.2832 1.3180 1.3534 1.3894 1.4262 1.4634 1.5015 1.5402 1.5799 1.6201 1.6613 1.7033 1.7462 1.7901 1.8350 1.8809 1.9279];
F1 = @(X,x,y) x.*x+X(1).*x.*y+X(2).*y.*y+X(3)*x+X(4)*y + X(5)
% 圆锥曲线 X为系数
F = @(X) F1(X,x1,y1)
X0 = [0.3 0.4 0.4 0.4 0.5] % Starting guess
[Xf,resnorm] = lsqnonlin(F,X0) % Invoke optimizer Xf为拟合系数
syms x y
F2 = F1(Xf,x,y) % 拟合曲线 双曲线
xmax = max(x1);xmin = min(x1);
ymax = max(y1);ymin = min(y1);
ezplot(F2,[xmin,xmax,ymin,ymax]) % 拟合曲线 双曲线
hold on
plot(x1,y1,'*')
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询