How to i refer to columns and rows from my imported data?

9 ビュー (過去 30 日間)
mabdorab
mabdorab 2017 年 3 月 23 日
回答済み: KSSV 2017 年 3 月 27 日
I imported data from Exel into matlab. I didn't import the headings of each row however I noticed it automatically named the columns by their header in the workspace section. I have a 25 by 400 data set with a range of numerical and categorical information. The file is save as mortgagedata.xls. How do I refer to this in my script?
I tried: x=mortgagedata(:,[1:25]);
but it is saying it is says: Undefined function or variable 'mortgagedata'.
How do I get it to refer to them?
  1 件のコメント
Joshua
Joshua 2017 年 3 月 27 日
Generally when you import data into Matlab the data will show up in the workspace on the side of the Matlab window. See what it named the vectors or matrices that it imported and use those names. Alternatively, try something like this and refer to matrix A:
A=importdata('mortgagedata.xlsx');

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

回答 (1 件)

KSSV
KSSV 2017 年 3 月 27 日
Use xlsread.
[num,txt,raw] = xlsread(' mortgagedata.xls') ;
All the text data, number data will be read. Read the documentation xlsread.

カテゴリ

Help Center および File ExchangeWorkspace Variables and MAT Files についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by