size reduction and addition operator
Ältere Kommentare anzeigen
I have a file with 5 dimensions netcdf, longitude, latitude, levels, days and hours of pollutant emissions (224x178x7x7x24). I need to add (sum) all emissions of every hour of every day and all levels and also reduce the dimension of five to two dimensions. As a result I should be a matrix of latitude and longitude data combined emissions of the last three dimensions of netcdf file. Do I can indicate what form please? First of all, Thanks
Akzeptierte Antwort
Weitere Antworten (1)
the cyclist
am 18 Mai 2016
If the other answer I submitted is what you intended, you can get the same thing with the following one-liner:
% Some pretend data
netcdf = rand(224,178,7,7,24);
sum3 = sum(reshape(netcdf,224,178,[]),3);
2 Kommentare
Hernaldo Leyton
am 18 Mai 2016
the cyclist
am 18 Mai 2016
The best form of thanks is upvoting and/or accepting answers that are helpful. This rewards the contributor, and can point other users to helpful answers.
Kategorien
Mehr zu NetCDF finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!