how can I take the (x,y) coordinates of each point by having two different vectors for x and y respectively?
Afficher commentaires plus anciens
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?
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Surface and Mesh Plots dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!