Why is my plot plotting blank?
18 views (last 30 days)
Show older comments
Shuqing Qi on 2 Feb 2021
Commented: Timo Dietz on 3 Feb 2021
Why I keep getting blank for my graph? I figured out that if I change plot(i,P_t(i+1)) to plot(i,P_t(i+1),'.');hold on, it will work. But only I want is a smooth line printed.
Timo Dietz on 2 Feb 2021
Each loop you are plotting one point, only. So you either have to "hold on" the figure to prevent erasing all data before the next point to plot (this would give you some kind of scatter plot) or you have to plot the array at the end of the function.
So to get a line the last row in the function should look like
You got the point?
Find more on Annotations 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!