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/28 14:35:59
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开始的