フィルターのクリア

Read columns/rows from cvs

3 ビュー (過去 30 日間)
Maximilian Jatzkowski
Maximilian Jatzkowski 2018 年 11 月 29 日
回答済み: Alok Nimrani 2018 年 12 月 6 日
Hi!,
Im trying to read data from a csv file into matlab, and i want a specific column with a speficic range of rows. How do i do this? The code im trying to use is this:
temperatur17=readcsv('temperatur.csv',3289,3,[3289 3 3655 5])
so basically, i want to read only rows 3290 to 3654, and only column 4, to get a vector.
Thanks in advance!
  3 件のコメント
madhan ravi
madhan ravi 2018 年 11 月 29 日
Try using xlsread() with specified range by referring the doc to read the ranges
Maximilian Jatzkowski
Maximilian Jatzkowski 2018 年 11 月 29 日
how would that look?
xlsread(
xlsread('temperatur.xls','C3290:C3654')
or?

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

回答 (1 件)

Alok Nimrani
Alok Nimrani 2018 年 12 月 6 日
Hi Maximilian,
As suggested earlier, you can make use of 'xlsread()' to read values from a particular column for some specific rows. In your case, you can read column 4 values for rows numbered 3290 to 3654 as follows:
>> A = xlsread('temperature.xls','D3290:D3654');
Here, you can also specify the sheet number from which to read as follows:
>> sheet = 1;
>> A = xlsread('temperature.xls',sheet,'D3290:D3654');
By default, the sheet number is 1.
For more information, you may have a look at the following link: https://www.mathworks.com/help/matlab/ref/xlsread.html
Hope this helps.
Regards,
Alok

カテゴリ

Help Center および File ExchangeData Import and Export についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by