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 Exchange에서 Matrix 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