Invalid use of operator "

4 ビュー (過去 30 日間)
Scott Milliken
Scott Milliken 2020 年 2 月 27 日
コメント済み: Scott Milliken 2020 年 2 月 28 日
I was trying follow and replicate the example code for the Temperature/Humidity Matlab and continue to get the error as follows:
Error in /users/mss.system.Z1My17/Temperature Humidity Line:14 Column:5
In the line is the following:
13 thingSpeakWrite(writeChId, [temp, humidity, dewPointF], "Fields", [1,2,3]...
14 "TimeStamps", time, "Writekey", writeKey)
  2 件のコメント
Scott Milliken
Scott Milliken 2020 年 2 月 27 日
編集済み: Scott Milliken 2020 年 2 月 27 日
does not seem to matter whether it is a single or a double. The error is shorter if it is the double vs the single.
KALYAN ACHARJYA
KALYAN ACHARJYA 2020 年 2 月 27 日
yes

サインインしてコメントする。

採用された回答

Walter Roberson
Walter Roberson 2020 年 2 月 27 日
編集済み: Walter Roberson 2020 年 2 月 27 日
The ... ends the line immediately. There is no implied separator inserted. So you have a ] from the numeric list followed by the content of the second line which is some spaces and then the literal, exactly as if you had written the numeric list and then some spaces and then the string.
[1,2,3] "TimeStamps"
all as one parameter. Numeric list followed by string is not valid syntax in this context. You need to add the missing comma.
  5 件のコメント
Scott Milliken
Scott Milliken 2020 年 2 月 27 日
編集済み: Scott Milliken 2020 年 2 月 27 日
@Stephen, Thanks for the circle. I apologize as I didn't see the comma and at first I had 4 periods in there, then tried the comma at the end of the line. Tired eyes do that to me everytime.
@Walter, I just want it to run properly. It seems to run somewhat, there are still errors. The code lists numerous dew points, but then advises there is an error using Temperature Humidity line 13. Then it states to ensure the proper channel ID and Write key API are being used. From what I cans they are the proper ID and Key. Can't copy/paste into the code box. On the page I'm using there is no Code button to click on.
Scott Milliken
Scott Milliken 2020 年 2 月 28 日
Thanks all for the help. Not sure what I did but all is now working.
Thanks

サインインしてコメントする。

その他の回答 (0 件)

コミュニティ

その他の回答  ThingSpeak コミュニティ

カテゴリ

Help Center および File ExchangeRead Data from Channel についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by