Weeksdays on x-axis for multiple plots | MATLAB IoT Analytics | 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
Weeksdays on x-axis for multiple plots
No permission to create posts
May 5, 2019
5:01 am
Avatar
obod0002

Silver
Members
Forum Posts: 19
Member Since:
March 13, 2019
sp_UserOfflineSmall Offline

As I'm moving on using MATLAB's feature, there's another challenge occurring:

I'd like to display the days of the week on the x-axis. So far so simple, e.g. plot(data.Timestamps, data.TemperatureWeek1)
But I'd like to do that for data of lets say the last four weeks.

The data should not be displayed one after the other nor stacked one on top of the other but displayed in the 'some plot'.
Weekdays are identical regardless of which week the data is from. And distinguishing between the weeks could be easily done by its color and the legend.

How could I do that?
Thanks a lot

May 7, 2019
1:01 pm
Avatar
cstapels
Moderator
Members


Moderators
Forum Posts: 861
Member Since:
March 7, 2017
sp_UserOfflineSmall Offline

I think you will want to split your data series into multiple series for each week.
MATLAB allos you to search for a value and create a new variable with the values that match a condition.

for example, if
vector=(1:14);
Then
bigValues=vector(vector>10);
will provide all the values greater than 10 and store them in the variable bigValues.
You should be able to use this to sort your time values as well.

You can see an example of how to plot multiple series here.
https://www.mathworks.com/help/thingspeak/Compare-Temperature-Data-from-Three-Different-Days.html

Forum Timezone: America/New_York

Most Users Ever Online: 166

Currently Online:
15 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:

khanhNguyen_CT, susyburr, quijano__, meosuckhoe, briskpanda, Dejw0089

Moderators: cstapels: 460

Administrators: Hans: 405, lee: 457