finding the mean/average of the smallest values in a row
조회 수: 1 (최근 30일)
이전 댓글 표시
hi , i have a row and i want to find the average of the smallest values and the position of this minimum.
댓글 수: 0
답변 (1개)
Mann Baidi
2024년 5월 6일
For finding the minimum values for each row in a matrix, you can use the "min" function in MATLAB.
You can use the min function for your requirement as follows:
rng default % for reproducibility
A = rand(5,10)
% use min function to get smallest element from each row.
[min_numbers,idx] = min(A,[],2) % idx refers to the postition of the minimum number in the row
% use mean function
result = mean(min_numbers)
You can refer to the following example in the 'min' function documentation
I hope this helps resolve the query.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Descriptive Statistics에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!