Calculate Average or Mean of a matrix
5 次查看(过去 30 天)
显示 更早的评论
a=[5 2;5 6;8 8]; How to calculate the average of this matrix using function?
Answer is like (5+5+8/3,2+6+8/3)
0 个评论
采纳的回答
更多回答(1 个)
Maneet Kaur Bagga
2022-7-6
Hi, Minhaz Parveez
As per my understandig you want to calculate the mean of each coloumn of the matrix. By default MATLAB fuctions work on coloumns therefore you can use the mean function directly. Please refer to the code below. Hope it helps!
X = [5 2;5 6;8 8]
mean(X)
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!