Thingspeakwrite error when using string array
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Dion Guek
el 13 de Nov. de 2017
Editada: Christopher Stapels
el 20 de Dic. de 2017
This string of code is taken from the thingSpeak documentation for matlab. I just copy and paste but still got this error. I would very much appreciate it if anyone can tell me where i did wrong
2 comentarios
Geoff Hayes
el 13 de Nov. de 2017
Dion - which version of MATLAB are you using? If you type doc thingSpeakWrite what does the documentation say about the data (second) input (are strings allowed)?
Respuesta aceptada
Christopher Stapels
el 20 de Dic. de 2017
Editada: Christopher Stapels
el 20 de Dic. de 2017
When you write string data to ThingSpeak, it generally wants to have a cell array. You should not usually need to do the String() conversion yourself. Try
thingSpeakWrite(349672,{ans},'Location',[-40,23],'WriteKey',writeKey);
and
thingSpeakWrite(channelID,{2.3,'on','good'},'Location',[-40,23],'WriteKey',writeKey);
Ill have a look at fixing that documented example, thanks for pointing it out.
0 comentarios
Más respuestas (0)
Comunidades de usuarios
Más respuestas en ThingSpeak Community
Ver también
Categorías
Más información sobre ThingSpeak en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!