set all the values of row i to zero in two dimensional array.
조회 수: 4(최근 30일)
표시 이전 댓글
%Finding Neighbor
Nbr=zeros(n);
R=20;
for i=1:1:n
for j=i+1:1:n
distance=sqrt( (S(i).xd-(S(j).xd) )^2 + (S(i).yd-(S(j).yd) )^2 );
s(i,j)=distance;
s(j,i)=distance;
if distance< R
Nbr(i,j)=1;
Nbr(j,i)=1;
end
end
end
%% follwing gives no of neighbours of each i
for i=1:1:n
count(i)=sum(Nbr(i,:));
end
%%%%QUESTION%%%%%%
%%% How do I set the all the values of a row i to zero in matlab , some thing like this
Nbr(i,:)={0}
댓글 수: 0
추가 답변(0개)
참고 항목
범주
Find more on Operators and Elementary Operations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!