Plot an Array of Structures

버전 1.0.0.0 (2.17 KB) 작성자: Jonathan Sullivan
This utility will plot an array of structures.
다운로드 수: 261
업데이트 날짜: 2011/7/29

라이선스 보기

PlotAS Linear plot of an arrays of structures
This function is used to plot arrays of structures, like those recieved
from shaperead. It will autorecognize some common coordinate field
names. The user may also specify their own. It will take in all the
LineSpec and PropertyName/PropertyValue inputs plot will take. The
largest limitation of this function is it can only handle one array of
structures at a time. This is primarily to be able to correctly parse
the inputs each time. If you would like to plot multiple arrays of
structures on the same plot, you will have to call plotAS several
times.

Syntax:
plotAS(S)
plotAS(S,LineSpec)
plotAS(S,LineSpec,'PropertyName',PropertyValue)
plotAS(xname,yname,S)
plotAS(xname,yname,S,LineSpec);
plotAS(xname,yname,S,LineSpec,'PropertyName',PropertyValue);
hs = plotAS(xname,yname,S,LineSpec,'PropertyName',PropertyValue);

The following coordinate field names are auto recognized:
x y
X Y
xs ys
Xs Ys
XS YS
Lon Lat
lon lat
Lons Lats
lons lats
LON LAT
LONS LATS

Example 1: Basic Functionality
S = shaperead('usastatehi');
plotAS(S)

Example 2: Adding Linespec
S = shaperead('concord_roads');
plotAS(S(101:end))
hold on;
plotAS(S(1:100),'r')

Example 3: Specificying xfieldname and yfieldname
S.range = 0:1e3;
S.relativePower = S.range.^0.5;
plotAS('range','relativePower',S,'r')
xlabel('Range (m)');
ylabel('Relative Power')

J Sullivan, May 2011

인용 양식

Jonathan Sullivan (2024). Plot an Array of Structures (https://www.mathworks.com/matlabcentral/fileexchange/32385-plot-an-array-of-structures), MATLAB Central File Exchange. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R2011a
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 2-D and 3-D Plots에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
버전 게시됨 릴리스 정보
1.0.0.0