Plot: dealing with data available only on weekdays
2 views (last 30 days)
Show older comments
I want to plot X (date), Y, and Z. Y has an entry for every day but Z has entry only for weekdays (not weekends). Will the code
plot(X,Y)
hold on
plot(X,smooth(Z))
will give us the smooth (that is, no gaps for Z) graphs? What will be the best way to deal with these data?
3 Comments
dpb
on 11 Jun 2018
You have a general purpose programming language in front of you; you can drive it however desired. The problem is to define what it is you really want in order to implement it.
At least a few of the options would be to
- ignore weekends entirely
- use real time and plot data where they fall
- use real time and missing values for weekends
- use real time and interpolate data for missing values
It all depends on what the data represent and what you want to try to depict...
Answers (1)
per isakson
on 11 Jun 2018
Edited: per isakson
on 11 Jun 2018
I assume
- X and Y have the same length
- Z is shorter than X
- Y and Z hold one value per day
- the length of X is less than 120
Am I right so far?
I would
- depict the values with markers, rather than lines, e.g. Square and Diamond, respectively
- not show anything for Z for weekends
2 Comments
per isakson
on 11 Jun 2018
Edited: per isakson
on 11 Jun 2018
- How do you synchronize Z with Y? How do you know which Z-value belong to which weekday?
See Also
Categories
Find more on Calendar in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!