Averaging data between two integer and corresponding column of a matrix
Ältere Kommentare anzeigen
I have this type of matrix
A = [1 2 3 4 5 6; 1.234 1.11 1.3 2.31 2.3 2.4]'
I want to average all data between two integer of 2nd column and corresponding data of firs clumn to form new matrix
1 Kommentar
Sudhir Rai
am 23 Mär. 2023
Antworten (1)
A = [1 2 3 4 5 6; 1.234 1.11 1.3 2.31 2.3 2.4]' ;
idx = fix(A(:,2))==2 ;
mean(A(idx,1))
1 Kommentar
Sudhir Rai
am 22 Mär. 2023
Bearbeitet: Sudhir Rai
am 23 Mär. 2023
Kategorien
Mehr zu Image Segmentation finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!