Plot is not working
7 views (last 30 days)
Show older comments
Via on 9 Apr 2019
Hi! I don't know what I'm doing wrong here. My plot doesn't show any lines nor scatter points. What is wrong with this?
Your T is a vector, and your Y is a scalar. There is no singular line because it is actually plotting all 5 points as individual line objects. check it out:
The above code should plot 5 circular markers.
a will return 5 line objects.
if you ran this:
% here, both arguments are of the same size.
% All I did was repeat Y n number of times equal to the length of T
then a will return 1 line object, that is a line.
also, dont put a space between plot and the parentheses.
let me know if this clears your question
^ You want Y to be a function of a vector, instead of just a constant (which is again, why you only got 1 point for 5 separate line objects).
I suggest looking into the documentation for plot()
More Answers (0)
Find more on Discrete Data 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!