Create x and y coordinates with available values

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)

2 件のコメント

KALYAN ACHARJYA
KALYAN ACHARJYA 2022 年 7 月 2 日
Already I provided the answer, any issue?
Muhamad Arung
Muhamad Arung 2022 年 7 月 3 日
no, thankyou

サインインしてコメントする。

 採用された回答

KALYAN ACHARJYA
KALYAN ACHARJYA 2022 年 7 月 2 日

0 投票

cor_xy=[randi(20),randi(30)]
cor_xy = 1×2
11 10

その他の回答 (1 件)

Image Analyst
Image Analyst 2022 年 7 月 2 日

0 投票

Try
randomX = min(x) + range(x) * rand(1);
randomY = min(y) + range(y) * rand(1);

カテゴリ

製品

リリース

R2018a

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by