Readmatrix / readtable works on ThingsSpeak ?

2 views (last 30 days)
sylvain didelot
sylvain didelot on 11 Oct 2019
Answered: Vinod on 11 Oct 2019
Hello, I'm trying to collect data to plot on :
https://thingspeak.com / Apps / MATLAB Visualisations / Custom (no starter code) / Edit / MATLAB Code :
M = readmatrix('C:\mypath\TEST.xlsx','Sheet','TEST1')
or
T = Readtable('C:\mypath\TEST.xlsx','Sheet','TEST1')
But it returns :
Error using readmatrix (line 148) Unable to find or open 'C:\mypath\TEST.xlsx'.
Check the path and filename or file permissions. Error in Custom (no starter code) 13 (line 1) M = readmatrix('C:\mypath\TEST.xlsx','Sheet','TEST1')
or
Error using readtable (line 223) Unable to open file '‪C:\mypath\TEST.xlsx' as a workbook.
Check that the file exists, read access is available, and the file is a valid spreadsheet file. Error in Custom (no starter code) 8 (line 1) T = readtable('‪C:\mypath\TEST.xlsx','Sheet','TEST1')
Even with a single excel sheet, it does the same.
So, does import file.csv is the only way to collect data from an excel on ThingSpeak ?
Thanks you,

Answers (1)

Vinod
Vinod on 11 Oct 2019
If you have access to desktop MATLAB or MATLAB online, you can load the contents of the CSV file in MATLAB and use thingSpeakWrite to write the data to a channel.
If you don't have access to MATLAB, the options are to use the CSV import functionality on ThingSpeak, or, to read the CSV file in your language of choice and write it to the channel using the documented bulk_update API on ThingSpeak.
If you're trying to use the MATLAB Analysis app on ThingSpeak, keep in mind it operates in the cloud and cannot access your local drive ('C:\' ).

Communities

More Answers in the  ThingSpeak Community

Categories

Find more on ThingSpeak in Help Center and File Exchange

Products


Release

R2019b

Community Treasure Hunt

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

Start Hunting!