Log scaling problem | MATLAB | Forum

Avatar

Please consider registering
Guest

Search

— Forum Scope —






— Match —





— Forum Options —





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

Register Lost password?
sp_Feed sp_TopicIcon
Log scaling problem
Avatar
David
New Member
Forum Posts: 4
sp_UserOfflineSmall Offline
1
September 8, 2016 - 7:27 pm
sp_Permalink sp_Print

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.

Avatar
piajola

Gold
Forum Posts: 76
sp_UserOfflineSmall Offline
2
September 8, 2016 - 11:52 pm
sp_Permalink sp_Print

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

Avatar
David
New Member
Forum Posts: 4
sp_UserOfflineSmall Offline
3
September 10, 2016 - 12:40 pm
sp_Permalink sp_Print

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:
24 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

rw950431: 252

Vinod: 164

cstapels: 96

piajola: 75

vespapierre: 63

Adarsh_Murthy: 59

Newest Members:

epicpaymentsny

DanielBobby

mercedeszw18

ujuxoketate

olihfez

winnieeq69

Forum Stats:

Groups: 4

Forums: 17

Topics: 1313

Posts: 4565

 

Member Stats:

Guest Posters: 1

Members: 5703

Moderators: 0

Admins: 2

Administrators: Hans, lee