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

1 visualización (últimos 30 días)
x=0.2
y=3,5,7

Respuesta aceptada

KSSV
KSSV el 11 de Mayo de 2018
x=0.2 ;
y=[3,5,7]
plot(x,y,'*r')
In such cases, you need to use a marker.
  1 comentario
Stephan
Stephan el 11 de Mayo de 2018
Hi,
nice to know - i always thought length of x and y have to be equal.
Best regards
Stephan

Iniciar sesión para comentar.

Más respuestas (1)

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

Categorías

Más información sobre 2-D and 3-D Plots en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by