Correction of measurement data by interpolation

Hi!
I have some corrupt measurement data, which I want to correct. The data acquisition system didn't get an actualized value in the correct time interval. It should get a new value after 0,2s. It happens, that I get the next value e.g. after 10s. My recorded data shows then 10s the same value and afterwards a big step to the next value. I need a script which recognizes where this happens and it shall correct it by interpolation.
Can you help me?
Kind regards
Andreas Wagner

댓글 수: 10

Please attach the code you use for importing that file and creating the vectors you are plotting.
It obviously requires xlsread, however it has such a strange format that I have no idea how to use the result.
Sounds like diff() and interp() or interp1() are the primary tools you'll need.
jonas
jonas 2018년 8월 15일
편집: jonas 2018년 8월 15일
The data you attached exhibit no such behaviour. Consistent steps of 0.2 (see attachment)
@Star Strider: I was able to import it simply by
A=xlsread('data.csv')
I could read it easily enough. Making sense of it is impossible.
I want to know how Andreas Wagner read and formatted the data shown in the plot image.
Thus, my Comment.
jonas
jonas 2018년 8월 15일
편집: jonas 2018년 8월 15일
I'm not sure what has happened to the upload. When I download the file to my computer I get a plain excel-sheet with two columns, from which I can reproduce the figure AW attached. I've attached the data here. When I download the same file to my phone I get something completely different.
EDIT: after a closer look, the content is obviously the same but its formatted in a very strange way on my phone. Probably has to do with excel version?
It would be best to upload it as a ‘.txt’ file instead. That avoids version problems.
All I know is that it looked completely weird when I used:
[D,S] = xlsread('data.csv');
I requested the second ‘S’ output because I saw a number of NaN values in ‘D’.
I am using Excel 2016 and MATLAB R2018a.
jonas
jonas 2018년 8월 15일
Yep, same issue on my phone. Took me a while to understand your last comment, as everything worked on my end :)
Anyway, I put the data as a txt in the previous comment. Still, there are no 'skipped data', so not much to work with...
Sometimes you have 3 numbers per line and sometimes 4 numbers per line. Is this one of those numerical formats that use a comma for the decimal point rather than a dot/period? Otherwise, why are there different number of numbers on each line?
Comma is the decimal separator
I've uploaded the file as .mat.
Kind regards

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

답변 (0개)

카테고리

도움말 센터File Exchange에서 Logical에 대해 자세히 알아보기

제품

질문:

2018년 8월 15일

댓글:

2018년 10월 8일

Community Treasure Hunt

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

Start Hunting!

Translated by