How do I create an interactive connected graph in MATLAB GUI

조회 수: 7 (최근 30일)
Jigar Gada
Jigar Gada 2015년 6월 30일
답변: Sreeram Mohan 2015년 7월 7일
I want to create a connected graph in Matlab GUI. All the nodes of the graph are buttons which changes its color when clicked. Adding the buttons in GUI is easy but how do I add the lines between any 2 nodes depending on the adjaceny matrix?
Example of such a graph:
  댓글 수: 2
Geoff Hayes
Geoff Hayes 2015년 7월 4일
Jigar - what code have you written so far? Are you using GUIDE?
Jigar Gada
Jigar Gada 2015년 7월 6일
Hi Geoff,
I have not written any code yet. I am still stuck on the logic to generate a dynamic GUI based on the adjacency matrix. Even if one can figure how to draw lines in the GUI, I can write codes to draw dynamic GUIs.

댓글을 달려면 로그인하십시오.

답변 (1개)

Sreeram Mohan
Sreeram Mohan 2015년 7월 7일
Hi Jigar,
Have you tried looking at properties of the button i.e. set or get properties and may be there is one related to the current location of the pushbutton. You could use that to draw a line between the positions returned. I have not tried this but could be an approach to try !!
--sreeram

카테고리

Help CenterFile Exchange에서 Graph and Network Algorithms에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by