Finding data off excel sheet
이전 댓글 표시
In the excel sheet attached, the data is 3 different sensors 0,1 and 2(1st column), their voltage(2nd column) and time of the reading(3rd column). I'm struggling to find a way to seperate the full data set into one set of voltage readings and time readings for each sensor. This is what I have
A = xlsread('forcetest.csv');
idx1 = find(A == 0)
I used xlsread just because I think it is easier. I know I have to used the find function, this code I have so far just finds what rows are the censor 0, how to I get it to give me all those rows with the given voltage and time data? Do I have to use a for-loop?
댓글 수: 7
Bryce Keeler
2016년 7월 4일
편집: Bryce Keeler
2016년 7월 4일
Not entirely sure what you're asking for, but I think what you mean is you want all the data associated with the "Sensor 0" rows? In that case the the code you are looking for is
idx1 = A(find(A==0),:);
Luke Radcliff
2016년 7월 4일
Luke Radcliff
2016년 7월 4일
Bryce Keeler
2016년 7월 5일
Good to hear! Would you mind accepting it as an answer then?
Image Analyst
2016년 7월 5일
He could if you post it below AS and answer, instead of here as a comment.
Luke Radcliff
2016년 7월 13일
Image Analyst
2016년 7월 13일
Well like I said in my answer it wouldn't have worked anyway since it finds 0's anywhere, not just in column 1.
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 MATLAB에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!