I want to be able to extract an elevation profile that is oriented 050 degrees from north throught the entire matrix. However, I need to do this for hundreds of profiles and therefore I don't want to pick the points interactively using improfiler. I want to just tell improfiler to extract a profile along a certain angle from north (in this case 050 degrees). I can extract a profile using the improfile function but as far as I can tell I have to manually enter the x-y coordinates as vectors in order to define the line as 050 from north as I have done in the example below. How can I tell improfiler to extract the elevation data at 050 degress from north where the profile cuts through the entire matirx rather than just a stated vetora and without using the interactive function?
I = DEM.Z;
x = [195 218];
y = [153 125];
n = sqrt((abs(x(1,1)-(x(1,2)))^2)+( abs(y(1,1)-(y(1,2)))^2));
[cx,cy,c] = improfile(I,x,y,n);
Eventaully, I want to be able to extract a profile every one meter oriented 050 degress from north along a set line between two points . However, I haven't even thought about how to do this loop yet and at this point all I want to know is how to get the profile at 050 through the entire matrix.
Any advice is greatly approciated! Thanks