function gplot(A, coord)
// to simulate the function of gplot in Matlab
// A: nxn matrix, must be upper triangular, symmetric, and 0 at diagonal
positions
// coord: nx2 matrix, coordinate(x,y)
// simple version: no error
checking
sa
= size(A);
n
= sa(1,1);
for i = 1:n
for j = i:n
if A(i,j) then
plot([coord(i,1)
coord(j,1)],[coord(i,2) coord(j, 2)],'*-');
end
end
end
endfunction
GMT+8, 2024-11-11 01:13 PM , Processed in 0.057440 second(s), 20 queries , Gzip On.
Powered by Discuz! X3.4 Licensed
© 2001-2023 Discuz! Team.