How to change the size of a matrix by filling with nan's?
11 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
採用された回答
Fangjun Jiang
2011 年 6 月 28 日
Preempt z with NaNs and then fill with data
z=nan(10,10)
z(2:6,3:7)=magic(5)
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!