主要内容

getvaropts

获取变量导入选项

描述

例子

瓦格= getvaropts (选择选择返回指定的变量的变量导入选项选择

例子

全部折叠

控件访问控制变量导入的变量导入选项对象getvaropts函数。

从文件中创建导入选项。options对象是单个变量导入选项的集合。

opts = detectimportoptions(“patients.xls”
Sheet properties: Sheet: " Replacement properties: missinggrule: 'fill' ImportErrorRule: 'fill' Variable Import properties:使用setvartype VariableNames: {'LastName', 'Gender', 'Age'…{'char', 'char', 'double'…} SelectedVariableNames: {'LastName', 'Gender', 'Age'…和7}VariableOptions:显示所有10 VariableOptions访问VariableOptions sub-properties使用setvaropts / getvaropts VariableNamingRule:“修改”范围属性:DataRange:“A2”(启动细胞)VariableNamesRange:“A1”RowNamesRange: VariableDescriptionsRange:“VariableUnitsRange:显示一个表的预览,预览使用

获取指定变量的变量导入选项对象。

varOpts = getvaropts(选择,“收缩”
varOpts = NumericVariableImportOptions with properties: Variable properties: Name: 'Systolic' Type: 'double' FillValue: NaN TreatAsMissing: {} QuoteRule: 'remove' Prefixes: {} suffix: {} emptyfieldrole: 'missing' Numeric Options: ExponentCharacter: 'eEdD' DecimalSeparator: '.'千分号:" TrimNonNumeric: 0 NumberSystem: 'decimal'

要修改变量导入选项,请参阅setvaroptssetvartype函数引用页面。

输入参数

全部折叠

文件导入选项,指定为SpreadSheetimportOptions.DelimitedTextImportOptions,或者多个沃特托利选项对象创建的detectImportOptions函数。的选择对象包含控制数据导入过程的属性,如变量属性、数据位置属性、替换规则等。

选定的变量,指定为字符向量,字符串标量,字符向量,字符串数组,数字索引数组或逻辑阵列。

变量名(或下标)必须是包含在VariableNames财产的财产选择目的。

例子:'高度'

例子:{“高度”,“姓”}

例子:9 [5]

数据类型:字符|字符串|细胞|uint64

输出参数

全部折叠

所选变量的类型相关选项,作为变量导入选项对象的数组返回。属性中指定的每个变量对应的数组包含一个对象选择论点。根据变量的数据类型,数组中的每个对象都是以下类型之一:数字、文本、逻辑约会时间, 和分类

您可以修改单个对象的属性。

介绍了R2016b