带循环的复杂公式的表达问题。
Show older comments
[code]function result
for j=1:10
f=@(x)(((1-x.^j)^(1-.j).*x.^(j.*(j-1)))+1).^(1./j);
g=mgsint(f,0,1,1000000,5)
end[/code]
错误代码是这样的
??? Error using ==> mpower
Inputs must be a scalar and a square matrix.
Error in ==> result>@(x)(((1-x.^j)^(1-j).*x.^(j.*(j-1)))+1).^(1/j) at 3
f=@(x)(((1-x.^j)^(1-j).*x.^(j.*(j-1)))+1).^(1/j);
Error in ==> mgsint>gsint at 30
g=(b-a)/2*sum(A.*feval(f,(b-a)/2*t+(a+b)/2));
Error in ==> mgsint at 26
g=g+gsint(f,x(i),x(i+1),A,t);
Error in ==> result at 4
g=mgsint(f,0,1,1000000,5)
我想的是mgsint里的错误应该就是公式表达出错才造成的 所以可以暂时不管mgsint函数
原始的表达式是这样的
p就是那个循环参数iAccepted Answer
More Answers (0)
Categories
Find more on 电子表格 in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!