RESAMPLING DATA

조회 수: 4 (최근 30일)
Ivan Mohler
Ivan Mohler 2012년 5월 16일
Hi,
I am new here. I have Excell file with one column. In this column there are about 10 000 process data (let say temperatures). I need to export every 15th data to a new excell (every 15th row from first to the last one). Can someone help me?
Thanks in advance, Ivan
  댓글 수: 3
Daniel Shub
Daniel Shub 2012년 5월 16일
Is there a reason you are not doing this directly in Excel? What have you tried so far in MATLAB?
Ivan Mohler
Ivan Mohler 2012년 5월 16일
I would like to generate this problem in Matlab, because I have a lots of problem when I have in one column more then 10 000 data... I am doing some modelling in matlab, so I wanna solve this kind of problem in it. If someone has got global answer for this kind of problems, please help me....

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

채택된 답변

Kye Taylor
Kye Taylor 2012년 5월 16일
One way:
numData = xlsread('yourExcelFile.xlsx'); % read in data
numDataOut = numData(1:15:end); % subsample (get every 15th row)
xlswrite('yourNewExcelFile.xlsx', numDataOut); % write out data
  댓글 수: 3
Ivan Mohler
Ivan Mohler 2012년 5월 17일
Kye, it works....Thanks a lot.
Can you tell me how can I do this but with rows?
Do you into (familiar) filters...The thing is I need some smoothing filter for my data....
If you are into I can explane to you much more deeper...
Kye Taylor
Kye Taylor 2012년 5월 17일
You probably realized this, but "end" inside indexing parentheses returns the largest valid index at that location.
To subsample rows, replace the second command with
numDataOut = numData(1:15:end,:);
Notice numData(1:15:end,:) referes to rows 1, 16,31,... and all the columns associated with these rows (that's the ,:). (That is, you will write out the entire first, sixteenth, thirtyfirst rows etc.)
You'll probably have more luck asking a specific question about the type of filtering you're into on the main answers page. In the meantime, you might find the following cool:
t = linspace(0,1,1024);
x = sin(2*pi*t);
noisyx = x + .1*randn(size(x));
% smooth it using local averaging
windowWidth = 20;
smoothedx = conv(noisyx, 1/windowWidth*ones(1,windowWidth),'same');
figure,plot(t,noisyx,'r',t,smoothedx,'b')
legend('original signal', 'smoothed signal');

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

추가 답변 (1개)

Ivan Mohler
Ivan Mohler 2012년 5월 16일
I would like to generate this problem in Matlab, because I have a lots of problem when I have in one column more then 10 000 data... I am doing some modelling in matlab, so I wanna solve this kind of problem in it. If someone has got global answer for this kind of problems, please help me.... Kye Taylor --> I will try your solution and report you... Tell me is the "end" my last row in my column (real number) or? Thanks...here you soon...

카테고리

Help CenterFile Exchange에서 Multirate Signal Processing에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by