Assigning the number for each x and y in the plot?

1 view (last 30 days)
Hi All, I have a matrix with 3 column and I should say the first column indicates the x position of nodes, second column indicates the y position of nodes and third column is node number. I am going to see plot x and y which shows the node number for each of them. I know for plotting I should used the following Plot (nodes(:,1), nodes(:,2)) It works but my problem is that I don't know how I can have a number of nodes (column 3) in the plot?? because the main goal is that to plot specific nodes location. I would appreciate if you please guide me to solve that.
Many thanks

Accepted Answer

KSSV
KSSV on 6 Apr 2017
N = 10 ;
A = rand(10,2) ;
nodes = [1:N]' ;
A = [A, nodes] ;
plot(A(:,1),A(:,2),'.r') ;
hold on
text(A(:,1),A(:,2),num2str(nodes))

More Answers (1)

maedeh amirpour
maedeh amirpour on 6 Apr 2017
Hi again Please have a look at my plot (attached). As the matrix is huge I cannot see the node number. Is there any ather wa
y? Regards

Categories

Find more on Line Plots in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!