How do I import data from an excel file and save it as a variable?

3 ビュー (過去 30 日間)
Ethan Echols
Ethan Echols 2016 年 2 月 25 日
コメント済み: Star Strider 2016 年 2 月 25 日
importdata('arm_biomech_hw.csv') t=arm_biomech_hw(:,1)
When ran, this script returns an error reading "reference to a cleared variable." I do not understand how the variable is cleared, considering it is loaded immediately before it is used.

採用された回答

Star Strider
Star Strider 2016 年 2 月 25 日
編集済み: Star Strider 2016 年 2 月 25 日
The importdata function (and all file import functions except load) have to have variables in which to put the data they import.
See if something like this works:
arm_biomech_mtx = importdata('arm_biomech_hw.csv');
t = arm_biomech_mtx(:,1);
  2 件のコメント
Ethan Echols
Ethan Echols 2016 年 2 月 25 日
Thanks!
Star Strider
Star Strider 2016 年 2 月 25 日
My pleasure!

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

その他の回答 (0 件)

カテゴリ

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