Reading Specific Data Into MATLAB from an Excel File
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I need to read data from the attached file into my program in MATLAB. How do I do this? I only need the columns listed below:
ismart_02_MAN x
ismart_02_MAN y
ismart_02_MAN z
ismart_02_RASI x
ismart_02_RASI y
ismart_02_RASI z
ismart_02_RLEPI x
ismart_02_RLEPI y
ismart_02_RLEPI z
ismart_02_RLMAL x
ismart_02_RLMAL y
ismart_02_RLMAL z
ismart_02_RTOE x
ismart_02_RTOE y
ismart_02_RTOE z
2 commentaires
KSSV
le 11 Fév 2019
YOu note down those columns......and pick only those columns by specifying range while reading using readtable or xlsread
Réponses (1)
Guillaume
le 11 Fév 2019
One way:
opts = detectImportOptions('Static_pose.xlsx'); %should automatically figure out what part of the excel file is a table
opts.SelectedVariableNames = opts.SelectedVariableNames(contains(opts.SelectedVariableNames, {'MAN', 'RASI', 'RLEPI', 'RLMAL', 'RTOE'})); %only keep variables with MAN, RASI, etc. in their name
t = readtable('Static_pose.xlsx', opts) %read table with only the selected variable names
Another way, if you want to look at other columns before keeping only the ones you want:
opts = detectImportOptions('Static_pose.xlsx'); %should automatically figure out what part of the excel file is a table
fulltable = readtable('Static_pose.xlsx', opts); %get table with all the columns
filteredtable = fulltable(:, contains(fulltable.Properties.VariableNames, {'MAN', 'RASI', 'RLEPI', 'RLMAL', 'RTOE'})); %only keep variables with MAN, RASI, etc. in their name)
I would think you may also want to keep the Frame column.
0 commentaires
Voir également
Catégories
En savoir plus sur Spreadsheets dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!