Reputation: 1711
I have one dimensional array and i need to calculate it's average.
I tried:
A = mean(mean(PSNRarr,2),2)
but I get an error.
If someone knows how to make it work it will be great!
Upvotes: 3
Views: 1800
Reputation: 78354
Try
mean(mean(PSNRarr))
more characters to get over SO minimum.
Upvotes: 4
Reputation: 21563
The easiest way that works for any amount of dimensions (assuming it is a regular matrix):
mean(PSNRarr(:))
However, if you have a cell array with numbers, try:
mean(mean(cell2mat(PSNRarr)))
Upvotes: 5