Log scaling problem | MATLAB | Forum

Avatar

Please consider registering
Guest

sp_LogInOut Log In sp_Registration Register

Register | 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: 86
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: 114

Currently Online:
17 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

rw950431: 261

Vinod: 196

piajola: 85

turgo: 70

vespapierre: 63

Adarsh_Murthy: 62

Member Stats:

Guest Posters: 1

Members: 5703

Moderators: 0

Admins: 2

Forum Stats:

Groups: 4

Forums: 17

Topics: 1313

Posts: 4565

Newest Members:

josephrj11, dennis55, jillhp4, tabathawg69, MarinaMa, Susandom

Administrators: Hans: 387, lee: 457