Log scaling problem | MATLAB IoT Analytics | Forum

The ThingSpeak community site has been upgraded to a new site. This site is currently in read-only mode. You can ask questions or post and read discussions on the new site.
Avatar

Lost password?
Advanced Search

— Forum Scope —






— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed sp_TopicIcon
Log scaling problem
No permission to create posts
September 8, 2016
7:27 pm
Avatar
David
New Member
Members
Forum Posts: 4
Member Since:
September 8, 2016
sp_UserOfflineSmall Offline

I'm trying to plot data on a log scale using this code fragment:

thingSpeakPlot(time, light, 'YScale','log');

however all I get is an empty chart.  The X-axis has time values, but no Y-axis value or data plotted.  The data is read in correctly - I can see it when I plot it without the log.  Can anyone shed some light on this.

September 8, 2016
11:52 pm
Avatar
piajola

Gold
Members
Forum Posts: 113
Member Since:
October 12, 2015
sp_UserOfflineSmall Offline

HI vwgtimk5,

It works without any issues in my case ... I hope this help you Smile

copy - paste this code (blindly, no questions, no typing) in a MATLAB Visualizations in MATLAB Code

time = 0:1:5
light = exp(time)
% thingSpeakPlot(time, light);
% thingSpeakPlot(time, light, 'YScale','log');

2 tries,

first try, erase % in first thingSpeakPlot and Save and Run.  See in "output" the values for time and light and the MATLAB Plot Output

second try, put again % in the first thingSpeakPlot and erase % in second thingSpeakPlot and Save and Run. See results.

Maybe the characters in your machine are different.(?)

Good luck

September 10, 2016
12:40 pm
Avatar
David
New Member
Members
Forum Posts: 4
Member Since:
September 8, 2016
sp_UserOfflineSmall Offline

It turns out that I had zeros in my data.  The log plot works fine once I adjusted the offending 0 values.

Forum Timezone: America/New_York

Most Users Ever Online: 166

Currently Online:
27 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

rw950431: 272

Vinod: 240

piajola: 95

turgo: 70

vespapierre: 63

Adarsh_Murthy: 62

Member Stats:

Guest Posters: 1

Members: 8665

Moderators: 1

Admins: 2

Forum Stats:

Groups: 3

Forums: 14

Topics: 1600

Posts: 5760

Newest Members:

kusmumichael, petersmith99, Rambant, blakeharriss09, optisol, Niyonzima Fils

Moderators: cstapels: 460

Administrators: Hans: 405, lee: 457