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 Comments

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.
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 on 15 Aug 2018
Edited: jonas on 15 Aug 2018
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.
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

Sign in to comment.

Answers (0)

Products

Asked:

on 15 Aug 2018

Commented:

on 8 Oct 2018

Community Treasure Hunt

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

Start Hunting!