立即註冊 登錄
痞酷網_PIGOO 返回首頁

SIMON1016的個人空間 https://bbs.pigoo.com/?9160 [收藏] [複製] [RSS]

日誌

To simulate the function of gplot in Matlab

已有 2037 次閱讀2019-1-14 04:15 PM

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


路過

雞蛋

鮮花

握手

雷人

評論 (0 個評論)

facelist

您需要登錄後才可以評論 登錄 | 立即註冊

關閉

站長小叮嚀上一條 /1 下一條

禁閉室|手機版|連繫我們|痞酷網電子技術論壇

GMT+8, 2024-4-25 08:09 PM , Processed in 0.053797 second(s), 20 queries , Gzip On.

Powered by Discuz! X3.4 Licensed

© 2001-2023 Discuz! Team.