Create x and y coordinates with available values

2 Ansichten (letzte 30 Tage)
Muhamad Arung
Muhamad Arung am 2 Jul. 2022
Kommentiert: Muhamad Arung am 3 Jul. 2022
I have a value of x(0 - 20) and a value of y (0-30) then I will coordinate the X horizontal axis and Y vertical axis with these values, how is th code to make the x and y coordinates? and determine a random point between x and y for example (1,2)

Akzeptierte Antwort

KALYAN ACHARJYA
KALYAN ACHARJYA am 2 Jul. 2022
cor_xy=[randi(20),randi(30)]
cor_xy = 1×2
11 10

Weitere Antworten (1)

Image Analyst
Image Analyst am 2 Jul. 2022
Try
randomX = min(x) + range(x) * rand(1);
randomY = min(y) + range(y) * rand(1);

Kategorien

Mehr zu Graphics Object Programming finden Sie in Help Center und File Exchange

Tags

Produkte


Version

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by