From: Thomas Chamberlain on
I have a set of gridded topography data and I want to take some profiles through it to be able to analyse it.
Obviously if the profiles went vertically or horizontally across my grid I could just use the corresponding columns or rows of the matrix, but i would like to specify the start and end points of my profiles, some of which will be at an angle.

I have looked but cannot find the correct function to be able to extract such a profile from my data.

Any help would be greatly appreciated.

Tom
From: us on
"Thomas Chamberlain" <twchambers(a)hotmail.co.uk> wrote in message <hpkp2e$p8j$1(a)fred.mathworks.com>...
> I have a set of gridded topography data and I want to take some profiles through it to be able to analyse it.
> Obviously if the profiles went vertically or horizontally across my grid I could just use the corresponding columns or rows of the matrix, but i would like to specify the start and end points of my profiles, some of which will be at an angle.
>
> I have looked but cannot find the correct function to be able to extract such a profile from my data.
>
> Any help would be greatly appreciated.
>
> Tom

a hint:
- define the path XP/YP according to the angle...
- then, look at

help interp2;

us
From: Thomas Chamberlain on
Thanks for the help...

I tried this but to no avail. It seems like quite hard work for what I want to do... I also came across the improfile function, which looks to be just the sort of thing I need but obviously that works for images and not for a matrix dataset like mine!

Any suggestions on what I can do that's a little more simple?
From: us on
"Thomas Chamberlain" <twchambers(a)hotmail.co.uk> wrote in message <hpl02t$59g$1(a)fred.mathworks.com>...
> Thanks for the help...
>
> I tried this but to no avail. It seems like quite hard work for what I want to do... I also came across the improfile function, which looks to be just the sort of thing I need but obviously that works for images and not for a matrix dataset like mine!
>
> Any suggestions on what I can do that's a little more simple?

hardly...
anyhow, isn't the method suggested not simple enough(?)...
a call to SIN, one to COS, maybe after LINSPACE, all vectorized, of course, and you're set for INTERP2...
how did YOU try it(?)...
show CSSM your code...

us
From: Thomas Chamberlain on
Well to begin with I decided to plot my line using the line function and using x and y coordinates.
x=[400,1600];
y=[400,1400];
line(x,y)

The problem I am having is copying the data from the grid to this line.
I have checked the help files for interp2, which seems to have an image example of what I need, but no written code. The examples of code that are given seem to only interpret between the same number of dimensions and not from 2 dimensions to 1.

If you have any familiarity with Generic Mapping Tools then the grdtrack command is just what I'm looking for.
http://gmt.soest.hawaii.edu/gmt/doc/gmt/html/man/grdtrack.html

Apologies for not understanding, but I wouldn't normally use Matlab for such a task.
Thank you again for your help.