Azzera filtri
Azzera filtri

Need help on plotting the graph

1 visualizzazione (ultimi 30 giorni)
reez all
reez all il 7 Mag 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 Commento
Walter Roberson
Walter Roberson il 7 Mag 2012
You need to describe the behavior you want when the arrays are not symmetric.

Accedi per commentare.

Risposta accettata

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

Più risposte (0)

Categorie

Scopri di più su Graph and Network Algorithms in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by