Make two matrices of same length reducing the size of largest matrix
49 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Poulomi Ganguli
il 15 Ago 2017
Commentato: Ranjeet Singh
il 3 Ago 2022
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 Commenti
Risposta accettata
Ryan Klots
il 15 Ago 2017
Modificato: Ryan Klots
il 15 Ago 2017
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);
Vedere anche
Categorie
Scopri di più su Creating and Concatenating Matrices in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!