Effacer les filtres
Effacer les filtres

Need help on plotting the graph

1 vue (au cours des 30 derniers jours)
reez all
reez all le 7 Mai 2012
i need help on plotting the dot on the graph, although this will not affect my result but i really need it on my graph..
clearall;clc
sizeA=[20 20];
x1=1:sizeA(1);
for j=1:sizeA(2)
X(j,:)=x1;
Y(:,j)=x1';
end
plot(X,Y,'r*')
The problem in here is, this code only can be used if the dimension is same, but i required different dimension which is zeros(20,30). Thank you for your help.
  1 commentaire
Walter Roberson
Walter Roberson le 7 Mai 2012
You need to describe the behavior you want when the arrays are not symmetric.

Connectez-vous pour commenter.

Réponse acceptée

Walter Roberson
Walter Roberson le 7 Mai 2012
Guessing what you are trying to do here:
[X, Y] = ndgrid(1:sizeA(1), 1:sizeA(2));
plot(X, Y, 'r*');

Plus de réponses (0)

Catégories

En savoir plus sur Graph and Network Algorithms dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by