How to change the size of a matrix by filling with nan's?
조회 수: 14 (최근 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
채택된 답변
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!