matlab nlinfit的问题
f=@(a,t)a(1).*exp(a(2).*(t-a(3)))t=[1790,1800,1810,1820,1830,1840,1850,1860,1870,1880...
f=@(a,t)a(1).*exp(a(2).*(t-a(3)))
t=[1790,1800,1810,1820,1830,1840,1850,1860,1870,1880,1890,1900,1910,1920,1930,1940,1950,1960,1970,1980,1990,2000]
y=[3.9,5.3,7.2,9.6,12.9,17.1,23.2,31.4,38.6,50.2,62.9,76.0,92.0,106.5,123.2,131.7,150.7,179.3,204.0,226.5,251.4,281.4]
k=nlinfit(t,y,f,k0)
k0=[3.9,1,1790]
sse=sum((y-f(a,t)).^2)
哪里错了??? 展开
t=[1790,1800,1810,1820,1830,1840,1850,1860,1870,1880,1890,1900,1910,1920,1930,1940,1950,1960,1970,1980,1990,2000]
y=[3.9,5.3,7.2,9.6,12.9,17.1,23.2,31.4,38.6,50.2,62.9,76.0,92.0,106.5,123.2,131.7,150.7,179.3,204.0,226.5,251.4,281.4]
k=nlinfit(t,y,f,k0)
k0=[3.9,1,1790]
sse=sum((y-f(a,t)).^2)
哪里错了??? 展开
展开全部
clear;clc
f=@(a,t)a(1).*exp(a(2).*(t-a(3)))
t=[1790,1800,1810,1820,1830,1840,1850,1860,1870,1880,1890,1900,1910,1920,1930,1940,1950,1960,1970,1980,1990,2000];
y=[3.9,5.3,7.2,9.6,12.9,17.1,23.2,31.4,38.6,50.2,62.9,76.0,92.0,106.5,123.2,131.7,150.7,179.3,204.0,226.5,251.4,281.4];
k0=[1,0.01,1000]; % 初值放在此行
k=nlinfit(t,y,f,k0)
plot(t,y,'*',t,f(k,t))
sse=sum((y-f(k,t)).^2) % 不是f(a,t)
追问
谢谢 请问 我的问题是不是应该要a=nlinfit~?还有你是怎么算k0的?
ZESTRON
2024-09-04 广告
2024-09-04 广告
表面污染分析包括评估表面上存在的颗粒、残留物或物质。通过利用显微镜、光谱学和色谱法等技术,分析人员可以识别和表征污染物,以确定其成分和来源。这种分析在电子、制药和制造等各个行业中至关重要,以确保产品质量、性能和安全性。了解表面污染有助于实施...
点击进入详情页
本回答由ZESTRON提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询