Prev: keeping my GUI unclosed
Next: check_active_images
From: Eoin Murphy on 20 Jul 2010 11:25 Hi all, I am just wondering if it is possible to take a 'slice' across a 2D contour map. Say I have a X*X matrix which I plot using contour. I am only interested in certain slices of this contour. Using ginput I can find the the pixel values of the ends of the slice I am interested in. Is there any simple way for Matlab to take this information and generate a 1D matrix containing information only on this slice? Aside: If anyone has any experience using AIPS to deal with Radio Astronomy maps they will know how nasty a program this is to deal with! It can however easily take slices across a Radio map by simply specifying the pixel values of the slices. I would like to do this in Matlab so as to avoid AIPS but I don't know if it is possible.
From: Steven_Lord on 20 Jul 2010 11:55 "Eoin Murphy" <eoin.g.murphy(a)gmail.com> wrote in message news:i24f4h$qhg$1(a)fred.mathworks.com... > Hi all, > > I am just wondering if it is possible to take a 'slice' across a 2D > contour map. Say I have a X*X matrix which I plot using contour. I am > only interested in certain slices of this contour. Using ginput I can find > the the pixel values of the ends of the slice I am interested in. Is there > any simple way for Matlab to take this information and generate a 1D > matrix containing information only on this slice? What do you mean when you say "slice"? Using the example from HELP CONTOUR: [c, h] = contour(peaks); can you explain in a bit more detail what you're trying to do? Are you trying to select one of the contour levels and obtain information about the points on that contour? If so, look at the contour matrix returned by CONTOUR; the format of that matrix is given on the reference page for the CONTOURC function. Are you attempting to do something like draw a straight line from (5, 45) to (35, 5) and extract the heights of the surface being contoured at the coordinates on that line? If so, you should probably take your original data and use INTERP2 on it. Or are you trying to do something else? > Aside: If anyone has any experience using AIPS to deal with Radio > Astronomy maps they will know how nasty a program this is to deal with! > It can however easily take slices across a Radio map by simply specifying > the pixel values of the slices. I would like to do this in Matlab so as > to avoid AIPS but I don't know if it is possible. -- Steve Lord slord(a)mathworks.com comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ To contact Technical Support use the Contact Us link on http://www.mathworks.com
From: Eoin Murphy on 20 Jul 2010 12:17 > Are you attempting to do something like draw a straight line from (5, 45) to > (35, 5) and extract the heights of the surface being contoured at the > coordinates on that line? If so, you should probably take your original > data and use INTERP2 on it. > -- > Steve Lord > slord(a)mathworks.com > comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ > To contact Technical Support use the Contact Us link on > http://www.mathworks.com That is exactly what I am trying to do! I have looked at the interp2 function and I am still not exactly sure how I would do this. Any help you could give me would be highly appreciated! Thanks.
From: Steven_Lord on 20 Jul 2010 13:18 "Eoin Murphy" <eoin.g.murphy(a)gmail.com> wrote in message news:i24i61$gg6$1(a)fred.mathworks.com... >> Are you attempting to do something like draw a straight line from (5, 45) >> to (35, 5) and extract the heights of the surface being contoured at the >> coordinates on that line? If so, you should probably take your original >> data and use INTERP2 on it. >> -- >> Steve Lord >> slord(a)mathworks.com >> comp.soft-sys.matlab (CSSM) FAQ: >> http://matlabwiki.mathworks.com/MATLAB_FAQ >> To contact Technical Support use the Contact Us link on >> http://www.mathworks.com > > That is exactly what I am trying to do! I have looked at the interp2 > function and I am still not exactly sure how I would do this. Any help you > could give me would be highly appreciated! Your original data gives you the X, Y, and Z inputs to INTERP2. You can generate the coordinates of the points on the line segment between your two selected points easily, given the coordinates: point1 = [5; 45]; point2 = [35; 5]; t = 0:0.1:1; points = bsxfun(@times, point1, t) + bsxfun(@times, point2, (1-t)) % or xi = point1(1)*t+point2(1)*(1-t); yi = point1(2)*t+point2(2)*(1-t); % or you could use LINSPACE to generate xi and yi The rows of points (or the variables xi and yi) are the Xi and Yi inputs to INTERP2. -- Steve Lord slord(a)mathworks.com comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ To contact Technical Support use the Contact Us link on http://www.mathworks.com
|
Pages: 1 Prev: keeping my GUI unclosed Next: check_active_images |