How can i plot a graph with different y values for a particular x value?

 Accepted Answer

x=0.2 ;
y=[3,5,7]
plot(x,y,'*r')
In such cases, you need to use a marker.

1 Comment

Hi,
nice to know - i always thought length of x and y have to be equal.
Best regards
Stephan

Sign in to comment.

More Answers (1)

Hi,
x(1:3) = 0.2;
y = [3 5 7];
plot(x,y, '*', 'color', 'r')
gives you:
Best regards
Stephan

Categories

Find more on 2-D and 3-D Plots in Help Center and File Exchange

Tags

Asked:

on 11 May 2018

Commented:

on 11 May 2018

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!