MATLAB运行时:Attempted to access (1,0); index must be a positive integer or logical.for N=1:1:8 for k=0:1:20 A(N,k)=0 endend? Attempted to access (1,0); index must be a positive integer or logical.for N=1:8 for k=0:20 A(N,k+1)

来源:学生作业帮助网 编辑:作业帮 时间:2024/11/19 18:18:04
MATLAB运行时:Attempted to access (1,0); index must be a positive integer or logical.for N=1:1:8    for k=0:1:20        A(N,k)=0    endend? Attempted to access (1,0); index must be a positive integer or logical.for N=1:8    for k=0:20    A(N,k+1)
xTN@IJ'K mh599D%4& " bڂ'mMK1DNn63fY_6քdt4ܷO?0PU3P*   VD; 4UFd`2 \"X`fVYN)s ) ZBLLֈP׊CSeW5)6_O-.{  o${ue췶DQ䂸D^B¦HrB!I#9pcbRadbL@oXk[E>I@v ElJפ$ I

MATLAB运行时:Attempted to access (1,0); index must be a positive integer or logical.for N=1:1:8 for k=0:1:20 A(N,k)=0 endend? Attempted to access (1,0); index must be a positive integer or logical.for N=1:8 for k=0:20 A(N,k+1)
MATLAB运行时:Attempted to access (1,0); index must be a positive integer or logical.
for N=1:1:8
for k=0:1:20
A(N,k)=0
end
end
? Attempted to access (1,0); index must be a positive integer or logical.
for N=1:8
for k=0:20
A(N,k+1)=1;
end
end
for N=2:8
for k=1:20
if N>k
A(N,k+1)=nchoosek(2*k+N-1,k);
for i=0:k-1
A(N,k+1)=A(N,k+1)-A(N,i+1)*nchoosek(2*k-1-2i,k-i);
end
else
A(N,k+1)=nchoosek(2*k+N-1,k);
for i=0:k-1
A(N,k+1)=A(N,k+1)-A(N,i+1)*nchoosek(2*k-1-2i,k-i);
end
for j=0:k-N
A(N,k+1)=A(N,k+1)-A(N,j+1)*nchoosek(2*k-1-2*i,k-(N+j));
end
end
end
end
B=A'
改正了这段程序就采纳…………

MATLAB运行时:Attempted to access (1,0); index must be a positive integer or logical.for N=1:1:8 for k=0:1:20 A(N,k)=0 endend? Attempted to access (1,0); index must be a positive integer or logical.for N=1:8 for k=0:20 A(N,k+1)
k=0:1:20
matlab中最小的下标是1,不是从0开始的