MATLAB运行时:Attempted to access (1,0); index must be a positiv
来源:学生作业帮 编辑:作业帮 分类:综合作业 时间:2024/05/24 14:49:13
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'
改正了这段程序就采纳…………
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'
改正了这段程序就采纳…………
k=0:1:20
matlab中最小的下标是1,不是从0开始的
再问: 能不能吧那个程序改下?
matlab中最小的下标是1,不是从0开始的
再问: 能不能吧那个程序改下?
MATLAB运行时:Attempted to access (1,0); index must be a positiv
matlab运行出现问题,Attempted to access e(1,0); index must be a pos
Matlab 报错为Attempted to access f(64.4); index must be a posit
Matlab问题求大神帮忙Attempted to access Xs(-17.23); index must be a
运行Matlab时出现错误?Attempted to access rxd(500); index out of bou
matlab问题 Attempted to access w(1001); index out of bounds be
在MATLAB中,提示Attempted to access th(2,1); index out of bounds
matlab中出现 Attempted to access X(1); index out of bounds beca
Matlab新手,Attempted to access X(2); index out of bounds becau
matlab Attempted to access x(2); index out of bounds because
Attempted to access a(:,2); index out of bounds because size
不知道为什么报这样的错:Attempted to access e(10,:); index out of bounds