作业帮 > 数学 > 作业

matlab中的程序the length n of c is odd,the first (n+1)/2 are the

来源:学生作业帮 编辑:拍题作业网作业帮 分类:数学作业 时间:2024/04/29 01:43:37
matlab中的程序
the length n of c is odd,the first (n+1)/2 are the coefs,the last (n-1)/2 are the weights
x=-10:0.01:10;
f=erf(x);
g=zeros(1,length(f));
temp=sum(w);
w=[w 1-temp];
首先erf是一个求高斯分布的积分函数,sum(w)是一个求和的过程,但是w没有给出具体的数值或者函数过程
再问: erf误差函数吧,函数的变量可以为数组吗
再答: 当然可以
再问: f = @(x,c) x(1).^2+c.*x(2).^2;

c = 1.5;
X = fminsearch(@(x) f(x,c),[0.3;1])
X =

1.0e-04 *

-0.2447

0.3159
结果为三个数吗?为什么? x(1),x(2)分别代表什么