Make two matrices of same length reducing the size of largest matrix
조회 수: 19 (최근 30일)
이전 댓글 표시
Hello, I have two matrix, A = [318x1] and B = [313x1]. In order to compare between two, I need to make size of A same as that of B, by reducing the size of A. Any help?
댓글 수: 2
채택된 답변
Ryan Klots
2017년 8월 15일
편집: Ryan Klots
2017년 8월 15일
You could try something like
% Find out the length of the shorter matrix
minLength = min(length(A), length(B));
% Removes any extra elements from the longer matrix
A = A(1:minLength);
B = B(1:minLength);
참고 항목
카테고리
Help Center 및 File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!