matlab 赋不了值,将值为0的修改为inf,修改不了

for i = 1:1:point
for j = 1:1:point
if( allcoefdist(i,j) == 0)
allcoefdist(i,j)=inf;
end
end
end
结果很多原值为0的没有被修改为无穷大

% å¯èƒ½ point è¿‡å°
allcoefdist(allcoefdist==0) = inf;    % ä¸€å¥å°±å¤Ÿäº†ï¼Œé™¤éžæ˜¯éƒ¨åˆ†ä¿®æ”¹
温馨提示:答案为网友推荐,仅供参考
相似回答