how to load and read excel data into matlab?

1,745 ビュー (過去 30 日間)
Natasha
Natasha 2015 年 6 月 24 日
コメント済み: Walter Roberson 2023 年 1 月 9 日
How could I load and extract each individual column of this attached excel spreadsheet in matlab (excluding the headers only the values)?
Your assistance would be much appreciated
  1 件のコメント
Katalin
Katalin 2015 年 6 月 24 日
Have you tried the import wizard? It has lots of customisable options which you can make a script of at the end with the settings you want. Sorry if you have done this already..

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

回答 (4 件)

Image Analyst
Image Analyst 2015 年 6 月 24 日
Try
[numbers, strings, raw] = xlsread(filename);
Then use indexing to pull out what you want.
column1 = numbers(1:41);
or whatever indexes you want. Beware that not all of those output arguments have the first row as the first row. For example numbers might have the first row as the third row in the workbook if the workbook doesn't have any numbers until row 3.

david muchangi
david muchangi 2020 年 2 月 4 日
Give a name in an Open datatype Matrix-Form, then read the data into it
[riverresults]=xlsread('riverresults.xlsx');
% Syntax is [ Name of variable in matlab to hold data]=xlsread('File name+extension')
I've just tested it.
  1 件のコメント
Walter Roberson
Walter Roberson 2020 年 2 月 4 日
No, this would replace the second column with NaN when the poster had requested to read everything.
readtable() gets much further, but when used without care, readtable() would replace M36 'UNSURE LOOK AT FILEPG' with NaN.

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


Nhlamulo Neftor Baloyi
Nhlamulo Neftor Baloyi 2022 年 8 月 23 日
Results_Recorded=xlsread('riverresults.xlsx')
  1 件のコメント
Walter Roberson
Walter Roberson 2022 年 8 月 23 日
No, this would give nan for the second column and for M36 'UNSURE LOOK AT FILEPG'

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


Hans Scharler
Hans Scharler 2023 年 1 月 9 日
I would take a look at "readtable" in MATLAB.
filename = 'myfile.xlsx';
T = readtable(filename);
  1 件のコメント
Walter Roberson
Walter Roberson 2023 年 1 月 9 日
My responses above imply that there is a text entry inside a numeric column. You would need readcell()

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

カテゴリ

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