Clear Filters
Clear Filters

Average for 4d data

7 views (last 30 days)
Nurul Ain Basirah Zakaria
Commented: Ameer Hamza on 8 Nov 2020
Hi! How can I calculate the average for a 160x140x1x12 which are lat,lon,year and month. I want to calculate the average of month for one year.

Accepted Answer

Ameer Hamza
Ameer Hamza on 6 Nov 2020
You can specify the dimension to the mean() function
M = rand(160,140,1,12);
M_new = mean(M, 4)
  6 Comments
Nurul Ain Basirah Zakaria
sir, thank you very much. excuse me for my slow brain.
Ameer Hamza
Ameer Hamza on 8 Nov 2020
I am glad to be of help! :)

Sign in to comment.

More Answers (0)

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!