Resultados de
Hi there, I have been attempting to try and access the loaction of my device using the following code:
myChannel=*******;
ReadAPIKey='xxxxxxxxxxxx';
myData=thingSpeakRead(myChannel,'ReadKey', ReadAPIKey,'numpoints',100,'outputformat','timetable','location',1);
myVector=(myData.Latitude).^2+(myData.Longitude).^2+myData.Altitude.^2;
maxVector=max(myData.Latitude)^2+max(myData.Longitude)^2+max(myData.Altitude)^2;
myVector=myVector/maxVector;
myMap=geoscatter(myData.lat,myData.long,15,myVector,'filled');
geobasemap('satellite');
colormap jet;
I have about 100 entry points at this stage. However, i get the following error:
Error using .
Unrecognized table variable name 'lat'.
Error in Custom (no starter code) 2 (line 7)
myMap=geoscatter(myData.lat,myData.long,15,myVector,'filled');
I am attempting to access the location of a moving device. Meaning, the longitude and latitude values will be constantly changing, thus, I do not want to set my latitude or longitude value as a constant but i want it to keep on updating as my device moves around. How would I do this? How would I ammend this error without setting the "lat" or "long" as a consant before hand?
Further, my device should be constantly sending messages, this, the number of entries to which it will see the location of will be contantly changing. How can I thus not set the entry points as a specific value but rather have it update as my device sends messags?
Is there an easier or better way to do this?
Thanks