How to change the size of a matrix by filling with nan's?
11 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hello
I have x, y and z matrices relating to lat,long and depth of bathymetric surveys. I have this data for several years although each survey is in a slightly different position.
Therefore to make consistent plots and animations I need to first define one grid of x and y matrices which all the z matrices can relate to?
I am thinking if I take the smallest and largest eastings and northing from the x and y matrices and then create a new X and Y with these ranges I can use these to plot the different z values on however first I need to make z the same correct size but I want to do this by adding NaN's around the data so the survey area still remains unchanged but I can contour plot x,y,z and x,y,z1 and x,y,z2 etc... so that the coordinates are consistent.
I know this is not very clear but I am struggling to get my head round it at the moment! Any help would be much appreciated.
Thank you
3 commentaires
Réponse acceptée
Fangjun Jiang
le 28 Juin 2011
Preempt z with NaNs and then fill with data
z=nan(10,10)
z(2:6,3:7)=magic(5)
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur 2-D and 3-D Plots dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!