MATLAB 运行时出现下列错误?index must be a positive integer or logical
来源:学生作业帮 编辑:神马作文网作业帮 分类:英语作业 时间:2024/11/23 19:20:49
MATLAB 运行时出现下列错误?index must be a positive integer or logical.
程序在这,一个图像分割程序
map=reshape([1:n_pixels],size_image(1:2));
gap=zeros(size(map));
treerank=zeros(size_image(1:2));
size_segments=ones(size_image(1:2));
image_seg=image;
%Building pairs
n_pairs=numel(index);
idx2=reshape(map(:,1:end-1),[],1);
idx1=reshape(map(1:end-1,:),[],1);
pairs1=[ idx1;idx2 ];
pairs2=[ idx1+1;idx2+size_image(1) ];
for Q=Qlevels
iter=find(Q==Qlevels);
for i=1:n_pairs
C1=pairs1(index(i));
C2=pairs2(index(i));
%Union-Find structure,here are the finds,average complexity O(1)
while (map(C1)~=C1 ) C1=map(C1); end
while (map(C2)~=C2 ) C2=map(C2); end
% Compute the predicate,region merging test
g=256;
logdelta=2*log(6*n_pixels);
dR=(image_seg(C1)-image_seg(C2))^2;
dG=(image_seg(C1+n_pixels)-image_seg(C2+n_pixels))^2;
dB=(image_seg(C1+2*n_pixels)-image_seg(C2+2*n_pixels))^2;
logreg1 = min(g,size_segments(C1))*log(1.0+size_segments(C1));
logreg2 = min(g,size_segments(C2))*log(1.0+size_segments(C2));
dev1=((g*g)/(2.0*Q*size_segments(C1)))*(logreg1 + logdelta);
dev2=((g*g)/(2.0*Q*size_segments(C2)))*(logreg2 + logdelta);
dev=dev1+dev2;
predicat=( (dR
程序在这,一个图像分割程序
map=reshape([1:n_pixels],size_image(1:2));
gap=zeros(size(map));
treerank=zeros(size_image(1:2));
size_segments=ones(size_image(1:2));
image_seg=image;
%Building pairs
n_pairs=numel(index);
idx2=reshape(map(:,1:end-1),[],1);
idx1=reshape(map(1:end-1,:),[],1);
pairs1=[ idx1;idx2 ];
pairs2=[ idx1+1;idx2+size_image(1) ];
for Q=Qlevels
iter=find(Q==Qlevels);
for i=1:n_pairs
C1=pairs1(index(i));
C2=pairs2(index(i));
%Union-Find structure,here are the finds,average complexity O(1)
while (map(C1)~=C1 ) C1=map(C1); end
while (map(C2)~=C2 ) C2=map(C2); end
% Compute the predicate,region merging test
g=256;
logdelta=2*log(6*n_pixels);
dR=(image_seg(C1)-image_seg(C2))^2;
dG=(image_seg(C1+n_pixels)-image_seg(C2+n_pixels))^2;
dB=(image_seg(C1+2*n_pixels)-image_seg(C2+2*n_pixels))^2;
logreg1 = min(g,size_segments(C1))*log(1.0+size_segments(C1));
logreg2 = min(g,size_segments(C2))*log(1.0+size_segments(C2));
dev1=((g*g)/(2.0*Q*size_segments(C1)))*(logreg1 + logdelta);
dev2=((g*g)/(2.0*Q*size_segments(C2)))*(logreg2 + logdelta);
dev=dev1+dev2;
predicat=( (dR
下标越界了 仔细查查
matlab运行出现问题,Attempted to access e(1,0); index must be a pos
MATLAB运行时:Attempted to access (1,0); index must be a positiv
matlab程序运行错误 “Z must be a matrix,not a scalar or vector.”
运行Matlab时出现错误?Attempted to access rxd(500); index out of bou
matlab 出现Subscript indices must either be real positive inte
MATLAB出现?Subscript indices must either be real positive inte
matlab出现? Subscript indices must either be real positive int
matlab问题请教,运行时出现错误信息:Conversion to logical from sym is not p
之后的运行又出现:Subscript indices must either be real positive inte
matlab 为什么会出现Z must be a matrix,not a scalar or vector
MATLAB程序错误?Subscript indices must either be real positive in
用matlab图像配准中出现Subscript indices must either be real positive