How to find minimum of every two columns and rows?
Afficher commentaires plus anciens
Let A =randi(16,4);
A =
14 11 16 16
15 2 16 8
3 5 3 13
15 9 16 3
First I want to find minimum of every two column that is min(column1,column2) , min(column3,column4) in each row. Let the output be B
B=[11 16;2 8;3 3;9 3]
And then I want to find minimum of every two rows that is min(row1,row2) min(row3,row4) in each column. let the output be C
C=[2 8;3 3];
1- How can I get C for any n*n matrix?
2- Can I get the original matrix back with the help of C?
Any help in this regard will be much appreciated.
Thanks
Réponse acceptée
Plus de réponses (1)
1 - How can I get C for any n*n matrix?
If you download sepblockfun
then it will just be,
C=sepblockfun(B,[2,2],'min');
2- Can I get the original matrix back with the help of C?
No, it's not a reversible process.
1 commentaire
Ammy
le 27 Déc 2021
Catégories
En savoir plus sur Resizing and Reshaping Matrices dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!