opts = setvartype(opts, selection, types)
| Parameter | Description |
|---|---|
| opts | an import options object (delimited text or spreadsheet). |
| selection | variable names (character vector, string array or cell of character vectors) or numeric indices. |
| types | a single type applied to all selected variables, or one type per selected variable. |
| Parameter | Description |
|---|---|
| opts | the updated import options object. |
setvartype sets the data types of the selected variables of an import options object, updating both VariableTypes and the per-variable options.
opts = delimitedTextImportOptions('NumVariables', 2);
opts.VariableNames = ["id", "value"];
opts = setvartype(opts, ["id", "value"], 'double')
| Version | Description |
|---|---|
| 2.0.0 | initial version |