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

3 visualizaciones (últimos 30 días)
reta jon
reta jon el 25 de Sept. de 2021
Comentada: reta jon el 25 de Sept. de 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 ]

Respuesta aceptada

KSSV
KSSV el 25 de Sept. de 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

Más respuestas (0)

Categorías

Más información sobre Statistics and Machine Learning Toolbox en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by