getvaropts
변수에 대한 가져오기 옵션 가져오기
설명
예제
getvaropts
함수를 사용하여 변수 가져오기를 제어하는 variable import options 객체에 액세스합니다.
파일에서 가져오기 옵션을 생성합니다. options 객체는 개별 변수 가져오기 옵션의 모음입니다.
opts = detectImportOptions('patients.xls')
opts = SpreadsheetImportOptions with properties: Sheet Properties: Sheet: '' Replacement Properties: MissingRule: 'fill' ImportErrorRule: 'fill' MergedCellColumnRule: 'placeleft' MergedCellRowRule: 'placetop' Variable Import Properties: Set types by name using setvartype VariableNames: {'LastName', 'Gender', 'Age' ... and 7 more} VariableTypes: {'char', 'char', 'double' ... and 7 more} SelectedVariableNames: {'LastName', 'Gender', 'Age' ... and 7 more} VariableOptions: Show all 10 VariableOptions Access VariableOptions sub-properties using setvaropts/getvaropts VariableNamingRule: 'modify' Range Properties: DataRange: 'A2' (Start Cell) VariableNamesRange: 'A1' RowNamesRange: '' VariableUnitsRange: '' VariableDescriptionsRange: '' To display a preview of the table, use preview
지정된 변수에 대한 variable import options 객체를 가져옵니다.
varOpts = getvaropts(opts, 'Systolic')
varOpts = NumericVariableImportOptions with properties: Variable Properties: Name: 'Systolic' Type: 'double' FillValue: NaN TreatAsMissing: {} QuoteRule: 'remove' Prefixes: {} Suffixes: {} EmptyFieldRule: 'missing' Numeric Options: ExponentCharacter: 'eEdD' DecimalSeparator: '.' ThousandsSeparator: '' TrimNonNumeric: 0 NumberSystem: 'decimal'
변수 가져오기 옵션을 수정하려면 setvaropts
및 setvartype
함수 도움말 페이지를 참조하십시오.
입력 인수
파일 가져오기 옵션으로, detectImportOptions
함수에 의해 생성된 SpreadsheetImportOptions
, DelimitedTextImportOptions
또는 FixedWidthImportOptions
객체로 지정됩니다. opts
객체는 변수 속성, 데이터 위치 속성, 대체 규칙 같은 데이터 가져오기 프로세스를 제어하는 속성을 포함합니다.
선택한 변수로, 문자형 벡터, string형 스칼라, 문자형 벡터로 구성된 셀형 배열, string형 배열, 숫자형 인덱스로 구성된 배열 또는 논리형 배열로 지정됩니다.
변수 이름(또는 인덱스)은 opts
객체의 VariableNames
속성에 포함된 이름의 서브셋이어야 합니다.
예: 'Height'
예: {'Height','LastName'}
예: [5 9]
데이터형: char
| string
| cell
| uint64
출력 인수
선택한 변수에 대한 유형 종속 옵션으로, variable import options 객체로 구성된 배열로 반환됩니다. 이 배열은 selection
인수에 지정된 각 변수에 대응되는 객체를 포함합니다. 변수의 데이터형에 따라, 배열에 포함되는 각 객체는 숫자, 텍스트, logical
, datetime
또는 categorical
데이터형일 수 있습니다.
개별 객체의 속성은 수정할 수 있습니다.
Type
속성을 수정하려면setvartype
함수를 사용하십시오.기타 속성을 수정하려면
setvaropts
함수를 사용하십시오.
버전 내역
R2016b에 개발됨
참고 항목
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 MathWorks 사이트 방문이 최적화되지 않았습니다.
미주
- América Latina (Español)
- Canada (English)
- United States (English)
유럽
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)