Hi, i have error of "Assignment has more non-singleton rhs dimensions than non-singleton subscripts".
Error in Untitled10 (line 205) distAllTier1(i,j)= sqrt((node(i).x - node(j).x).^2 + (node(i).y - node(j).y).^2);
The details code as follow:
for i = 1:1:numNodes for j = indPCHTier1 if node(i).tier == 1 if i == j distAllTier1(i,j) = NaN; else distAllTier1(i,j)= sqrt((node(i).x - node(j).x).^2 + (node(i).y - node(j).y).^2); end else distAllTier1(i,j) = NaN; break; end end end
The result for
sqrt((node(i).x - node(j).x).^2 + (node(i).y - node(j).y).^2);
is:
ans = 10.295630140987001 21.213203435596427
Then the "distAllTier1(i,j)" cannot support the value. How can i solve this problem?
Thanks 🙂
Best Answer