Problem to read CSV file

Hi
My csv file is 402 rows and 2 columns (A and B).I want to read 2nd (B )column from 77 row and calculate average value. i tried like this. but it give me error. anyone please tell me how can i do it.
data=csvread('torque.csv',B77);
x=data(:,2);
B = x.';
y=mean(B)

回答 (1 件)

Omer Yasin Birey
Omer Yasin Birey 2019 年 1 月 14 日

0 投票

csvread('torque.csv',77,2,[77 2 77 2])

1 件のコメント

Israt Jahan
Israt Jahan 2019 年 1 月 14 日
Hi
It gives me following error
Index exceeds matrix dimensions.
Error in dlmread (line 152)
result = result{1};
Error in csvread (line 50)
m=dlmread(filename, ',', r, c, rng);
Error in torque (line 1)
data=csvread('torque.csv',77,2,[77 2 77 2]);
Cant understand why?

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

カテゴリ

ヘルプ センター および File ExchangeMatrix Indexing についてさらに検索

製品

リリース

R2017b

タグ

質問済み:

2019 年 1 月 14 日

コメント済み:

2019 年 1 月 14 日

Community Treasure Hunt

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

Start Hunting!

Translated by