From 2 vectors of n elements To n points

1 vue (au cours des 30 derniers jours)
Max
Max le 18 Nov 2012
Hi, if I have two vectors:
A=[
a1
a2
a3
a4
a5
a6
a7
]
and
B=[
b1
b2
b3
b4
b5
b6
b7
]
What's the command to create 7 points
p1=[a1, b1], p2=[a2,b2], ... p7=[a7,b7] ?
Thanks

Réponse acceptée

Matt J
Matt J le 18 Nov 2012
C=num2cell([A,B],2);
[p1,p2,p3,p4,p5,p6,p7]=deal(C{:});

Plus de réponses (2)

Azzi Abdelmalek
Azzi Abdelmalek le 18 Nov 2012
Modifié(e) : Azzi Abdelmalek le 18 Nov 2012
A=1:4
B=sin(t)
scatter(A,B)

Matt Fig
Matt Fig le 18 Nov 2012
P = [A,B];
Now point 1 is P(1,:). Point 2 is P(2,:), etc.

Catégories

En savoir plus sur Guidance, Navigation, and Control (GNC) 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