How to draw bunch of line segments?

I would like to draw [x1 x2],[y1 y2] line segments, and I have data in the form X1(i) = x1 etc. and i=1:1000; Is it possible to draw the lines without a for cycle?

 Respuesta aceptada

Jan
Jan el 22 de Ag. de 2017
You can. But what is the wanted result?
X1 = rand(1, 10);
X2 = rand(1, 10);
Y1 = rand(1, 10);
Y2 = rand(1, 10);
subplot(1,2,1)
plot([X1; X2], [Y1; Y2]) % A bunch of separate lines
subplot(1,2,2)
plot([X1; X2].', [Y1; Y2].') % Two polygones

Más respuestas (1)

Categorías

Más información sobre Graphics Performance en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 22 de Ag. de 2017

Respondida:

Jan
el 22 de Ag. de 2017

Community Treasure Hunt

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

Start Hunting!

Translated by