Thingspeakwrite error when using string array

2 Ansichten (letzte 30 Tage)
Dion Guek
Dion Guek am 13 Nov. 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 Kommentare
Geoff Hayes
Geoff Hayes am 13 Nov. 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)?
Dion Guek
Dion Guek am 13 Nov. 2017
Bearbeitet: Jan am 13 Nov. 2017
My matlab version is 2017b student edition. Based on the attached picture above, the data can be a string. This is taken from the doumentation page from https://www.mathworks.com/help/thingspeak/thingspeakwrite.html

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Christopher Stapels
Christopher Stapels am 20 Dez. 2017
Bearbeitet: Christopher Stapels am 20 Dez. 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.

Weitere Antworten (0)

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