MATLAB Answers

0

How to draw a zigzag line in MATLAB?

Asked by Lucifer__ on 19 Nov 2019 at 16:30
Latest activity Commented on by KALYAN ACHARJYA on 19 Nov 2019 at 16:56
I want x and y points from a zigzag line in a x,y mesh/grid. How do I draw it on matlab?

  0 Comments

Sign in to comment.

1 Answer

Answer by KALYAN ACHARJYA on 19 Nov 2019 at 16:46
Edited by KALYAN ACHARJYA on 19 Nov 2019 at 16:50

x=randi(100,[1,10]);
y=randi(100,[1,10]);
line(x,y)

  2 Comments

Lucifer__ on 19 Nov 2019 at 16:53
It is actually just a plot of random x,y's. What I want is a linear zig-zag line on x and y axis. Thanks.
KALYAN ACHARJYA on 19 Nov 2019 at 16:56
x=randi(100,[1,10]);
plot(x)

Sign in to comment.