MATLAB: How to automate selecting specific xyz map data from an existing xyz data set

mapsMATLABxyz data

I have a bathymetry map that provides a 1 meter resolution. However, I don't want all of the map data. I want a 1024X1024 meter section of the map so that I can run comparrisons. The xyz map data I have is lat/long/alt and I'd like to automate the process and be able to populate a 1024X1024 matrix with z data.
I have attached a link to the xyz file since it is too large and a .jpg file so that you can see what the map looks like. I've also drawn a blue box around the desired location.
website.jpg
This is a painful process to go cell by cell so I appriciate all help.
InkedShalebeds_1m10clr_LI.jpg

Best Answer

Walter and KSSV,
Sorry it's been a while. I figured it all out. I first determined the slope of the box I wanted and the top left point (could have pick any point). I then used algebra to compute the other corners of the box. I then did a linspace to make 2 sets of parallel lines with 256 points. I then created a for loop to connect the two lines using linspace again for 256 points inbetween the two lines. This resulted in a 256X256. Next, I had to get z data over. I used the reshape function to get my 256X256 into a single column, then used the griddata function for the z values and used reshape to get it back into a 256X256. Now I'm on to calculating Boltsman and Shannon entropy measure for comparrison! Thanks for all your help!