Importating Data from Excell
1 回表示 (過去 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 件のコメント
採用された回答
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 件のコメント
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
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...
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Spreadsheets についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!