how to read different columns from excel but write in the same variable in matlab?

1 回表示 (過去 30 日間)
vivian0925
vivian0925 2016 年 3 月 3 日
コメント済み: Bob 2016 年 3 月 3 日
Hello everyone, i´m quite new with matlab. I have one excel file and want to read the data with matlab script and plot them.
Due to the data is very big, i can´t fit them only with 4 columns in excel but with 8 columns (as you can see in the image above), i don´t know how i can change my script so that it will read all the 8 columns data but write in the same variable. For example: For A1 A5 A9... and E1 E5 E9... these values are belong to the same variable "Time", so i write in my script:
num=xlsread('Rxxx.xlsx','Tabelle1','A1:H1048576');
Time=num(1:4:end,1);
but it doesn´t read the column E1 E5 E9... but i need these value also saved in the same variable "Time"
How can i correct my script so it read read also E to H columns ? I have attached a sample of the excel file.
Thank you and best regards.
Vivian
  2 件のコメント
Bob
Bob 2016 年 3 月 3 日
can you provide the excel data?
vivian0925
vivian0925 2016 年 3 月 3 日
編集済み: vivian0925 2016 年 3 月 3 日
Sure, i have uploaded a sample of the excel file. I just want to understand how to read non-contiguous range from excel with matlab.

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

採用された回答

Bob
Bob 2016 年 3 月 3 日
編集済み: Bob 2016 年 3 月 3 日
I can't understand what exactly you want Mrs.
Do you only need to read column A1 A5 A9... E1 E5 E9....?
%%Read Column A
A=xlsread('R','A1:A40');
a=A(1:4:end);
%%Read Column E
E=xlsread('R','E1:E40');
e=E(1:4:end);
Time=[a;e];
  2 件のコメント
vivian0925
vivian0925 2016 年 3 月 3 日
thank you, now it works
Bob
Bob 2016 年 3 月 3 日
you welcome

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

その他の回答 (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