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

3 次查看(过去 30 天)
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 ]

采纳的回答

KSSV
KSSV 2021-9-25
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

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Statistics and Machine Learning Toolbox 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by