フィルターのクリア

Reading Specific Data Into MATLAB from an Excel File

2 ビュー (過去 30 日間)
Allison Bushman
Allison Bushman 2019 年 2 月 11 日
回答済み: Guillaume 2019 年 2 月 11 日
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 件のコメント
KSSV
KSSV 2019 年 2 月 11 日
YOu note down those columns......and pick only those columns by specifying range while reading using readtable or xlsread
Allison Bushman
Allison Bushman 2019 年 2 月 11 日
I'm relatively new to MATLAB. How do I do that?

サインインしてコメントする。

回答 (1 件)

Guillaume
Guillaume 2019 年 2 月 11 日
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.

カテゴリ

Help Center および File ExchangeSpreadsheets についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by