How do I make two vectors of different length equal in length

1 vue (au cours des 30 derniers jours)
reta jon
reta jon le 25 Sep 2021
Commenté : reta jon le 25 Sep 2021
How do I make the length of the two vectors equal according to the length of the shortest vector, ie, delete the values at the end??
A=[1 2 3 4 5 6 7 8]
B=[5 6 8 1 2 3 7 4 55 66 88]
The result
A=[1 2 3 4 5 6 7 8]
B=[5 6 8 1 2 3 7 4 ]

Réponse acceptée

KSSV
KSSV le 25 Sep 2021
A=[1 2 3 4 5 6 7 8]
A = 1×8
1 2 3 4 5 6 7 8
B=[5 6 8 1 2 3 7 4 55 66 88] ;
B = B(1:length(A))
B = 1×8
5 6 8 1 2 3 7 4

Plus de réponses (0)

Catégories

En savoir plus sur Statistics and Machine Learning Toolbox 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