How would I delete rows in a tall matrix to make it into a square matrix?
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
How would I delete rows in a tall matrix to make it into a square matrix? When given a tall matrix, what can I run to turn that tall matrix into a square matrix?
0 Commenti
Risposte (1)
Arif Hoq
il 4 Feb 2022
If i am right then....
Tall matrix, if m>n here m= row, n= column
Wide matrix, if m<n
Square matrix, if m=n
So, i think you have to add column to convert into square matrix from tall matrix, not deleting row.
m=4; % row
n=3; % column
tall_matrix=randi(10,m,n);
add_col= randi(10,n+1,1);
square_matrix= [tall_matrix add_col]
0 Commenti
Vedere anche
Categorie
Scopri di più su Multidimensional Arrays 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!