Matlab Analysis won't update my field!

Hi
I used this code to show last 20 field1 datas in field2 chart:
% Enter your MATLAB Code below
readChId = XXX;
readKey = 'XXXXX';
writeChId = YYY;
writeKey = 'YYYYY';
[Data,t] = thingSpeakRead(readChId,'Fields',1,'NumPoints',20,'readkey',readKey);
thingSpeakWrite(writeChId,Data,'Fields',2,'Timestamps',t,'Writekey',writeKey);
display (Data)
when i click save an run i can see Data in output box but i can't see anything in field2 chart!
i activate timecontrol for every 30 minuts but still i can't see any data in field2 chart :(
what is my problem?

Respuestas (1)

Vinod
Vinod el 12 de Jul. de 2020

0 votos

If you want a plot of your values, you need to use a MATLAB visualization and add the output to the view of your channel.

5 comentarios

Esmaeil Chehrehnama
Esmaeil Chehrehnama el 12 de Jul. de 2020
i can't use timecontrol to matlab visualization while i want to update my plot
so how can i update my matlabvisualization plot automatically?
Vinod
Vinod el 12 de Jul. de 2020
The MATLAB visualization auto updates if you have a paid ThingSpeak license. Also, it auto updates when the channel page is loaded if it has been 5 minutes since it was last updated.
Esmaeil Chehrehnama
Esmaeil Chehrehnama el 12 de Jul. de 2020
Editada: Esmaeil Chehrehnama el 12 de Jul. de 2020

Thank u for your answer. So what does the function "thingSpeakWrite" in Matlab Analysis do? Doesn't it write Data on my field?

Esmaeil Chehrehnama
Esmaeil Chehrehnama el 12 de Jul. de 2020
Editada: Esmaeil Chehrehnama el 12 de Jul. de 2020
Actually I am looking for a way to show only the last 20 data or the last 30 minuts of data on my field! How can i do that?
Christopher Stapels
Christopher Stapels el 23 de Jul. de 2020
thingSpeakRead(12397,'NumMinutes',20);

Iniciar sesión para comentar.

Comunidades de usuarios

Más respuestas en  ThingSpeak Community

Categorías

Más información sobre ThingSpeak en Centro de ayuda y File Exchange.

Productos

Preguntada:

el 12 de Jul. de 2020

Comentada:

el 23 de Jul. de 2020

Community Treasure Hunt

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

Start Hunting!

Translated by