How can I find the median of each element between 2 rows
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Hello I am a bit new to MATLAB syntax and get confused
I have a matrix of size 3x10.
I want to find the median between each element in the first row, and each element in the second row.
How can I do this? I will need to end up with 10 median values
0 Kommentare
Akzeptierte Antwort
Voss
am 30 Apr. 2022
% 3-by-10 matrix:
M = rand(3,10);
% median of each column:
median(M,1)
% 10-by-3 matrix:
M = rand(10,3);
% median of each row:
median(M,2)
4 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Creating and Concatenating Matrices finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!