FUNCTION REFERENCE
getvaropts
Get the options of variables in import options.
Get the options of variables in import options.
Syntax
vopts = getvaropts(opts, selection)Syntax
vopts = getvaropts(opts)Returns the options of the selected variables (a name, names, a string array or indices; all variables without a selection): one object of class matlab.io.NumericVariableImportOptions, TextVariableImportOptions, DatetimeVariableImportOptions, DurationVariableImportOptions, CategoricalVariableImportOptions or LogicalVariableImportOptions for one variable, an array of them for several. Each has Name, Type, FillValue, TreatAsMissing, QuoteRule, Prefixes, Suffixes and EmptyFieldRule, plus its type's options (DecimalSeparator, ThousandsSeparator, TrimNonNumeric and ExponentCharacter for numbers; WhitespaceRule for text; InputFormat, DatetimeFormat, DatetimeLocale and TimeZone for datetimes; InputFormat, DurationFormat and FieldSeparator for durations; Categories, Protected and Ordinal for categorical; TrueSymbols, FalseSymbols and CaseSensitive for logical).
Example
writetable(table([1; NaN], 'VariableNames', {'v'}), 'v.csv'); vopts = getvaropts(detectImportOptions('v.csv'), 'v'); vopts.FillValue % NaNDifferences from MATLAB: an array of several variable options is a struct array of objects (class struct).
These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.