Correction of measurement data by interpolation
Show older comments

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
Star Strider
on 15 Aug 2018
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.
Adam Danz
on 15 Aug 2018
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')
Star Strider
on 15 Aug 2018
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.
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?
Star Strider
on 15 Aug 2018
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
on 15 Aug 2018
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...
Image Analyst
on 16 Aug 2018
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?
Andreas Wagner
on 8 Oct 2018
Andreas Wagner
on 8 Oct 2018
Answers (0)
Categories
Find more on Logical in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!