lsqcurvefit在matlab中拟合函数问题clc;clear;cc=zeros(1);f=inline('cc(1)*x.^2','cc','x'); loadh1=[0,0.1,0,2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1];loadp1=[loadh1(1)^2*5,loadh1(2)^2*5,loadh1(3)^2*5,loadh1(4)^2*5,loadh1(5)^2*5,loadh1(6)^2*5,loadh1(7)^2*5
来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/23 17:38:27
lsqcurvefit在matlab中拟合函数问题clc;clear;cc=zeros(1);f=inline('cc(1)*x.^2','cc','x'); loadh1=[0,0.1,0,2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1];loadp1=[loadh1(1)^2*5,loadh1(2)^2*5,loadh1(3)^2*5,loadh1(4)^2*5,loadh1(5)^2*5,loadh1(6)^2*5,loadh1(7)^2*5
lsqcurvefit在matlab中拟合函数问题
clc;clear;
cc=zeros(1);
f=inline('cc(1)*x.^2','cc','x');
loadh1=[0,0.1,0,2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1];
loadp1=[loadh1(1)^2*5,loadh1(2)^2*5,loadh1(3)^2*5,loadh1(4)^2*5,loadh1(5)^2*5,loadh1(6)^2*5,loadh1(7)^2*5,loadh1(8)^2*5,loadh1(9)^2*5,];
[c1,resc1]=lsqcurvefit('f',1,loadh1,loadp1);
c1
%%%% 总是报错,应该是拟合函数形式写错了,我也不知道错在哪里.
lsqcurvefit在matlab中拟合函数问题clc;clear;cc=zeros(1);f=inline('cc(1)*x.^2','cc','x'); loadh1=[0,0.1,0,2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1];loadp1=[loadh1(1)^2*5,loadh1(2)^2*5,loadh1(3)^2*5,loadh1(4)^2*5,loadh1(5)^2*5,loadh1(6)^2*5,loadh1(7)^2*5
close all
clear,clc
f = inline('cc*loadh1.^2','cc','loadh1');
loadh1=[0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9]; % loadh1 与 loadp1 项数应相同
loadp1=[loadh1(1)^2*5,loadh1(2)^2*5,loadh1(3)^2*5,loadh1(4)^2*5,loadh1(5)^2*5,loadh1(6)^2*5,loadh1(7)^2*5,loadh1(8)^2*5,loadh1(9)^2*5,];
[c1,resc1]=lsqcurvefit(f,1,loadh1,loadp1)