Facing problem with the error ''Expected a string scalar or character vector for the parameter name''
显示 更早的评论
Everytime I want to execute the following programming on ThingSpeak Matlab Analysis, facing problem with thingSpeakWrite, and it is showing ''Expected a string scalar or character vector for the parameter name'' error.
Also how can I write every data instead of single data to write channel on ThingSpeak?
% Read the most recent data from the source channel
data = thingSpeakRead(readChannelID, 'ReadKey', readAPIKey, 'Fields', [1, 2], 'NumPoints', 7);
% Extract the values from the read data
values1 = data(:, 1) % Values from field 1
values2 = data(:, 2) % Values from field 2
% Write the data to the destination channel
thingSpeakWrite(writeChannelID, 'WriteKey', writeAPIKey, [values1, values2], 'Fields', [1, 2]);
3 个评论
Stephen23
2024-4-30
thingSpeakWrite(writeChannelID, 'WriteKey', writeAPIKey, [values1, values2], 'Fields', [1, 2]);
% ^ missing parameter name
Tanusree
2024-4-30
thingSpeakWrite(writeChannelID, 'WriteKey', writeAPIKey, 'Fields', [1, 2], rowData{:});
% this comma-separated list does not produce valid name-value pairs ^^^^^^^^^^
Making random changes is less efficient than following the documentation:
回答(0 个)
社区
更多回答在 ThingSpeak Community
类别
在 帮助中心 和 File Exchange 中查找有关 Prepare and Analyze Data 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!