找回密码
 注册
查看: 4097|回复: 4

[求助]如何用Matlab计算Jacobi多项式 (无内容)

[复制链接]
发表于 2005-1-28 09:05:24 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册

x
发表于 2005-2-20 22:12:33 | 显示全部楼层

[求助]如何用Matlab计算Jacobi多项式 (无内容)

发一个自己编的程序
你可以参考一下
%   This program is used to solver hilbert array.
%   刘百仓_houston
%   2004.11.03
format long
N=120;      % the dimension of hilbert array
e=1e-6;   % control variable
fprintf(';%s %d %s\n';, ';There are ';,N,';vectors.';);
x(1:N,1)=0.0;
%%%%%%%% generating hilbert array %%%%%%%%%%
for i=1:1:N
    for j=1:1:N
        A(i,j)=1/(i+j-1);
    end
    b(i,1)=sum(A(i,1:N));
end
% TT=A\b
%--------------------------------------------%
%%%%%%%% generating diag array of A %%%%%%%%%%
temp=diag(A);
for i=1:1:N
    D(i,i)=temp(i,1);
end
%--------------------------------------------%
U=triu(A)-D;    % Extract upper triangular part of A(not contain D)
DsL=tril(A);    % Extract lower triangular part (D+L)
Bg=-inv(DsL)*U; % -inv(D+L)*U
u=inv(DsL);     % inv(D+L)
x0(1:N,1)=-10.0;  % initial vector
x1(1:N,1)=0.0;
Iteration=0;    % count
while norm(x-x0)>e
      x1=Bg*x0+u*b;
      x=x0;
      x0=x1;
      Iteration=Iteration+1;
end
K=cond(Bg);
%%%%%%%% Output the calculated results  %%%%%%%%%%
fmt = ';%7.4f';; for i=2:10; fmt = strcat(fmt, '; %7.4f';); end;fmt = strcat(fmt,';\n';);
fprintf(fmt, x1);
fprintf(';\n';);
fprintf(';%s %d %s\n';, ';Iteration= ';,Iteration,';times.';);
K
%-------------------------------------------------%
 楼主| 发表于 2005-2-27 19:53:37 | 显示全部楼层

[求助]如何用Matlab计算Jacobi多项式 (无内容)

谢谢,只是采用这种方式过于复杂了,难得没有一行就能解决问题的方法吗?感觉MatLib应该有这种功能。
发表于 2005-12-11 19:56:57 | 显示全部楼层

[求助]如何用Matlab计算Jacobi多项式 (无内容)

   jacobian([x*y*z; y; x+z],[x y z])
 楼主| 发表于 2005-12-12 11:46:25 | 显示全部楼层

[求助]如何用Matlab计算Jacobi多项式 (无内容)

这是计算Jacobi矩阵的,我希望计算的是Jacobi多项式。当然,可以根据递推公式自己写程序来计算。我感觉,MatLib应该提供这种函数。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表