MATLAB Answers

Problem to read CSV file

2 views (last 30 days)
Israt Jahan
Israt Jahan on 14 Jan 2019
Commented: Israt Jahan on 14 Jan 2019
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)

  0 Comments

Sign in to comment.

Answers (1)

Omer Yasin Birey
Omer Yasin Birey on 14 Jan 2019
csvread('torque.csv',77,2,[77 2 77 2])

  1 Comment

Israt Jahan
Israt Jahan on 14 Jan 2019
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?

Sign in to comment.

Sign in to answer this question.

Tags

Products


Release

R2017b