Finding a mean for all my data
조회 수: 1 (최근 30일)
이전 댓글 표시
Hi, How do I find the mean of all the data given in rows and columns.
답변 (2개)
Star Strider
2018년 11월 28일
If you have a recent MATLAB release (definitely R2018b, possibly earlier), use the 'all' argument:
matrix = rand(5,7)
Avg = mean(matrix, 'all')
otherwise, convert it to a column vector first:
Avg = mean(matrix(:))
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Testing Frameworks에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!