2
votes

I am new to MatLab and trying to learn how can I use two matrix to draw a plot. I am working with "IEEE118Topology" data which represent 118 points/nodes in a power grid. One data set is 118x3. This represent the location of each node in a graph. Using the command:

plot(Location(:,2),Location(:,3),'-ro'); %I can draw this plot with all 118 nodes.

Location data set

But I have the second data-set that is 118x118. This data-set shows which nodes are connected to which nodes. Rather than plotting by just the location, Can you please tell me if there is a way I can combine both of these Matrix. Final plot should be as follows: enter image description here

Both these datasets are attached in the following link: https://www.dropbox.com/sh/98na8s16ggl1dqz/AABgvwy9RPjIJv4fNbt2WFrKa?dl=0

1

1 Answers

2
votes

You could use Matlab's in-built function GPlot

The second matrix you are referring is the 'Adjacency matrix', while the first matrix is the 'coordinates'.

%// as your actual coordinates are in 2nd and 3rd column 
Coordinates = Location(:,[2 3]); 

gplot(Adjacencymatrix,Coordinates);