loop for scatter plot
6 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I have four matrix A,B,C and D and each of them has a dimension of (56 rows, 4 coulms). I want to scatter the same column of each matrix with another matrix. X1=A(:,1),Y1=B(:,1);X2=A(:,2),Y1=B(:,2), ...,X4=A(:,4),Y4=B(:,4) X5=A(:,1), Y1=C(:,1),X6=A(:,2),Y6=C(:,2),...,Xn=C(:,4), Yn=D(:,4)
I did it for one of them but don't know how to use a loop to make a seperate scatter plot for all of them. I am grateful foe your help.
X1=A(:,1) Y1=C(:,1) scatter(X1,Y1);
0 commentaires
Réponse acceptée
Matt Tearle
le 19 Avr 2011
Like this?
plot([A,A,A],[B,C,D],'o')
EDIT Based on your comment, here's a new answer:
allX = [A,A,A];
allY = [B,C,D];
for k=1:size(allX,2)
figure(k)
scatter(allX(:,k),allY(:,k))
end
3 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Matrices and Arrays 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!