?? uszip3.m
字號:
function varargout = uszip3(varargin)
%USZIP3 US 3-digit ZIP code data.
% s = uszip3 Output all variables as structure 's'
%[x1,x2] = uszip3 Output only first 1, 2, etc., variables
% s = uszip3('x',...) Output only variables 'x', ... as struct. 's'
%[x,...] = uszip3('x',...) Output variables 'x', ... as variables
% = uszip3(...,is) Output subset 'x(is)' using SUBSETSTUCT(s,is)
% where 'is' is vector of elements to extract
%
% Loads data file "uszip3.mat" that contain the following variables:
% Code3 = m-element vector of m 3-digit ZIP (ZCTA) codes
% XY = m x 2 matrix of lon-lat (in decimal deg)
% ST = m-element cell array of m 2-char state abbreviations
% Pop = m-element vector of total population estimates (2000)
% isCUS = m-element logical vector if ZIP code is in continental U.S.
% House = m-element vector of total housing units (2000)
% LandArea = m-element vector of land area (square miles)
% WaterArea = m-element vector of water area (square miles)
%
% Example 1: Extract 3-digit ZIP codes of all cities in North Carolina
% NCzip = uszip3('Code3',strcmp('NC',uszip3('ST')))
%
% % NCzip = 270
% % ...
% % 289
%
% Example 2: 3-digit ZIP codes with population in continental U.S.
% z = uszip5(uszip5('isCUS') & uszip5('Pop') > 0);
% makemap(z.XY)
% pplot(z.XY,'g.')
%
% Derivation:
% 3-digit ZIP codes derived from 5-digit codes (see USZIP5) by using the
% centroid of the 5-digit code regions weighed by their land and water
% areas and, when the 5-digit are in multiple states, the median state. The
% population, housing, and land and water areas are the sum of the 5-digit
% values. If all 5-digit codes have zero areas, then each code given equal
% weight in calculating 3-digit lon-lat.
%
% See also USZIP5
% Copyright (c) 1994-2006 by Michael G. Kay
% Matlog Version 9 13-Jan-2006 (http://www.ie.ncsu.edu/kay/matlog)
% Input Error Checking ****************************************************
varnames = {'Code3','XY','ST','Pop','isCUS','House','LandArea','WaterArea'};
[errstr,varargout] = loaddatafile(varargin,nargout,varnames,mfilename);
if ~isempty(errstr), error(errstr), end
% End (Input Error Checking) **********************************************
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -