How to ask MATLAB to predict the next value in a graph
Show older comments
I have a linear graph with the cost of advertising on a platform over time, versus the date. I am looking to use Matlab to estimate the next point on the graph.
I have looked at YPred, but I am unsure about how to format my data so that it understands what it needs to make the prediction. I am also unclear as to what type of model I would be specifying.
ypred = predict(mdl,DATASET)
is what I am using, but it doesn't make any sense.
Any suggestions or advice would be appreciated, I have exhausted the MATLAB resources sadly.
Accepted Answer
More Answers (1)
Cris LaPierre
on 18 Jan 2019
0 votes
You could also consider fitting the data using polyfit, then calculating the y value for a given x value using polyval. The this example in the documentation.
1 Comment
Helena Leathers
on 22 Jan 2019
Categories
Find more on 2-D and 3-D Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!