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

조회 수: 3 (최근 30일)
reta jon
reta jon 2021년 9월 25일
댓글: reta jon 2021년 9월 25일
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