How to generate straight lines to 2D target points, each straight line is connected by 10 points which represent 10 steps from (0,0) to target point, for example (5,6)?

2 views (last 30 days)
Hi, I am a beginner on MATLAB, recently I was stuck on a task, look forward to your help.
My question is How to generate straight lines to 2D target points, each straight line is connected by 10 points which represent 10 steps from (0,0) to target point, for example (5,6)?
Thank you very much
  3 Comments

Sign in to comment.

Accepted Answer

darova
darova on 4 Apr 2021
What about this
x = rand(20,1);
y = rand(20,1);
line([x x*0]',[y y*0]')

More Answers (0)

Categories

Find more on MATLAB in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!