Remove one data-value from data set?

10 Ansichten (letzte 30 Tage)
Thomas Nilsson
Thomas Nilsson am 27 Okt. 2019
Beantwortet: Thomas Nilsson am 28 Okt. 2019
Hi
I am running a channel logging temperatures. When I made an update to the channel and added a field. The first field for some reason got one logged data that was wrong and way off, this must have come from the channel edit I made rather than from the arduino update. Because the value is -127 and the arduino type the data is based on is unsigned.
Can I somehow remove this single data from the dataset? If so, how?
Thanks!

Antworten (2)

ME
ME am 27 Okt. 2019
It is quite difficult to help without knowing the format in which you have your data stored. But, assuming that you have an array of temperatures then you could just use:
temp(temp==-127)=[]
  2 Kommentare
Thomas Nilsson
Thomas Nilsson am 27 Okt. 2019
Hi
Well, I really don't know how it is stored. I write data to thingspeak as it is measured. One single item of that data is wrong, and it happened exactly when I made a change to that channel, adding a field to the settings of the channel.
ME
ME am 28 Okt. 2019
Well then I guess I’d point you to this page which discusses the same issue. Seems like it is difficult to do directly in thingspeak but can be done by exporting the data, removing your “bad” point and then importing the corrected version.

Melden Sie sich an, um zu kommentieren.


Thomas Nilsson
Thomas Nilsson am 28 Okt. 2019
I found these ways.
For the "normal" thingspeak field chart, I used the "Data min" option to filter out all values below zero. This made my faulty one disappear for this display.
For the Matlab chart, I used the following code to remove any data sample below zero. This made the faulty one disappear for the matlab display.
[data, time] = thingSpeakRead(readChannelID, 'Field', fieldID1, 'DateRange',[datetime(2019,10,25,20,30,00),datetime(2020,10,25,20,30,00)], 'ReadKey', readAPIKey);
TF = data(:,1) < 0;
data(TF,:) = [];
time(TF,:)=[];
%% Visualize Data %%
plot(time, data);

Communitys

Weitere Antworten in  ThingSpeak Community

Kategorien

Mehr zu ThingSpeak finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by