www.gusucode.com > images 案例代码 matlab源码程序 > images/PlotMultisegmentLineFromImageExample.m

    %% Plot Multisegment Line from Image
%  
%%
%  Read image.

% Copyright 2015 The MathWorks, Inc.

I = imread('liftingbody.png');
%%
% Specify _x_- and _y_-coordinates that define line segments.
x = [19 427 416 77];
y = [96 462 37 33];
%%
% Display 3-D plot of the pixel values of these line segments.
improfile(I,x,y),grid on;