how can I take the (x,y) coordinates of each point by having two different vectors for x and y respectively?
Show older comments
Lets say that I have a matrix T=[1 2 1 2 3;1 2 4 1 2;0 2 1 3 4;2 1 0 3 1] I used the below code in order to have a plot
figure, axis([0 10 0 10]);
grid on; hold on;
[m,n] = size(T);
m = m*2 - 0.5;
n = n*2 - 0.5;
for i = 1:size(T,1)
I = (i-1)*2;
for j = 1:size(T,2)
J = (j-1)*2 + 0.5;
if(T(i,j)>0)
plot(J,m-I,'b.','MarkerFaceColor', 'b');
end
if(T(i,j)>1)
plot(J+1,m-I-1,'b.','MarkerFaceColor', 'b');
end
if(T(i,j)>2)
plot(J+1,m-I,'b.','MarkerFaceColor', 'b');
end
if(T(i,j)>3)
plot(J,m-I-1,'b.','MarkerFaceColor', 'b');
end
end
end
how can I take the (x,y) coordinates of each point from the plot by having two different vectors for x and y respectively?
Accepted Answer
More Answers (0)
Categories
Find more on Surface and Mesh Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!