make a point varies

1 Ansicht (letzte 30 Tage)
Al Rico
Al Rico am 20 Mai 2020
Beantwortet: Walter Roberson am 20 Mai 2020
how to generate three points on matlab, where the middle one varies?
  2 Kommentare
Rik
Rik am 20 Mai 2020
You probably need the rand function, but with this little detail it is hard to give a specific example.
Al Rico
Al Rico am 20 Mai 2020
I function that shoud draw lines between these tree points, the side points are fixed, to point on the middle moves by Y axis so the function will draw multple lines from one point A(first point) to multiple points(or a point that varies) found in the same Y axis that join them in one third point B,

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Walter Roberson
Walter Roberson am 20 Mai 2020
When A and B are the lower bound and upper bound respectively, then
A + rand() * (B-A)
will be a random point between the two.
This should not return A or B exactly as outputs in normal operation, but could do so in the extreme case that A and B are in the range eps(realmin) to eps(realmin)*2^52 (2.2250738585072e-308)

Kategorien

Mehr zu Random Number Generation finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by