selecting and averaging rows of a matrix

1 view (last 30 days)
Melissa
Melissa on 11 Oct 2013
Answered: Image Analyst on 12 Oct 2013
Hi!
I have a 1040 x 70 matrix of latitudes, longitudes and heights. I want to make a new matrix of latitudes and longitudes increasing in 0.5 steps, with height an average of all the previous heights within that range of latitudes/longitudes. I have tried loops and selecting rows, but am getting nowhere :(
Any advice?
  1 Comment
Azzi Abdelmalek
Azzi Abdelmalek on 11 Oct 2013
How latitudes, longitudes and heights are represented in your matrix?

Sign in to comment.

Answers (2)

Matt J
Matt J on 11 Oct 2013
Edited: Matt J on 11 Oct 2013
Sounds like you might be looking for griddedInterpolant() or interp2().

Image Analyst
Image Analyst on 12 Oct 2013
If your rows are in steps of 1.0 presently, and if you have the Image Processing Toolbox, you can use.
newMatrix = imresize(oldMatrix, 2.0);

Categories

Find more on Line Plots in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!