Importating Data from Excell

조회 수: 1 (최근 30일)
T
T 2013년 8월 30일
Suppose I want to read the third column of data from an Excel sheet.
the format of the data increments every 5 ms.
0 5 10 15 ... ... 995 0 5 10 15 ... ... 995
Then after 995, it goes back to 0. There are about 80,000 entries. How can I make the vector accumulate rather than reset once it reaches 1000?
Thanks
  댓글 수: 2
Iain
Iain 2013년 8월 30일
편집: Iain 2013년 8월 30일
Errr, do you want to know:
How to read the third column from an excel sheet? How to make excel's third column increment in 5ms steps from 0 to some upper limit? How to make matlab create a column that increments in 5ms steps from 0 to some upper limit?
T
T 2013년 8월 30일
Well there are two columns of interest.
The number of elements in each column is say 86,000.
in column two I time as described above, and the third column I have measured data.
If I want to construct a new time [0, 5, .... ] (up to 86,000 entries, can I still associate that time with each element in the third column?

댓글을 달려면 로그인하십시오.

채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2013년 8월 30일
% Example
a=0:5:995;
a=repmat(a,1,5)'; % your array
%-------------------------------
b=reshape(a,numel(0:5:995),[]);
[n,m]=size(b);
c=1000*(0:m-1);
out=bsxfun(@plus,b,c);
out=out(:)
  댓글 수: 4
T
T 2013년 8월 30일
Sorry, why *5? The frequency 5 is 5 milliseconds, then I would need to convert the entire array to just seconds.
Azzi Abdelmalek
Azzi Abdelmalek 2013년 8월 30일
편집: Azzi Abdelmalek 2013년 8월 30일
You can adapt it yourself:
c3=M(:,3);
C2=0:0.005:(numel(c3)-1)*0.005;
plot(c2,c3)

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Iain
Iain 2013년 8월 30일
third_col = xlsread(filename, sheet#, 'C:C')';
times = 0:5:((86000-1)*5);
plot(times,third_col)
The "n"th part of third_col happens at the "n"th time in times...

카테고리

Help CenterFile Exchange에서 Spreadsheets에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by