How to draw a zigzag line in MATLAB?

I want x and y points from a zigzag line in a x,y mesh/grid. How do I draw it on matlab?

Answers (1)

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

2 Comments

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.

Sign in to comment.

Categories

Find more on MATLAB in Help Center and File Exchange

Asked:

on 19 Nov 2019

Commented:

on 19 Nov 2019

Community Treasure Hunt

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

Start Hunting!