readmatrix non-adjacent columns
26 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Jacob Matson
el 16 de Ag. de 2020
Editada: Walter Roberson
el 5 de Nov. de 2023
I would like to import 3 columns of a excel/csv file into a matrix. The columns I want are non-adjacent (Columns C, P, Q). I can import all the columns between C-Q adjacent columns like:
M=readmatrix('file.csv', 'Range', 'C:Q' );
However, I don't wan't columns D-O. I try things like this and it doesn't work.
M=readmatrix('file.csv', 'Range', 'C:C, C:Q' );
How do I only import the 3 colmns C, P, Q into 1 matrix?
0 comentarios
Respuesta aceptada
Walter Roberson
el 17 de Ag. de 2020
Editada: Walter Roberson
el 5 de Nov. de 2023
readmatrix accepts import options generated with detectImportOptions. You can use selectedVariables option to indicate which variables to read.
1 comentario
Jose Carrasco
el 5 de Nov. de 2023
I would further point out that import options available in one variable can be assessed before using opts.SelectedVariableNames by running detectImportOptions(variable) on it.
Más respuestas (0)
Ver también
Categorías
Más información sobre Spreadsheets en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!