Plotting graph using arrays

23 visualizaciones (últimos 30 días)
Shantanu Vachhani
Shantanu Vachhani el 25 de Oct. de 2017
Comentada: Jackson Brandeberry el 23 de Oct. de 2020
x=zeros(1,10);
x(2:4) =1;
y= linspace(0,10,10);
plot(y,x)
I want a straight vertical line but matlab is giving me a slant line.Any solution?
  1 comentario
Jackson Brandeberry
Jackson Brandeberry el 23 de Oct. de 2020
How do you then find the equation of the graph?

Iniciar sesión para comentar.

Respuestas (1)

KSSV
KSSV el 25 de Oct. de 2017
x = [1 1 2 3 4 4 5 6 7 8 9 10] ;
y = [0 1 1 1 1 0 0 0 0 0 0 0] ;
plot(x,y)

Categorías

Más información sobre Graph and Network Algorithms 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