randomly generate point satisfying quations

hello, everyone. I wonder if there is any way to randomly generate 50 points satisfying the following equaiton?

4 comentarios

Rik
Rik el 21 de Mayo de 2019
Rewrite the formula so you get y as a function of x. Then you can get random x values and get the corresponding y values.
zilai si
zilai si el 21 de Mayo de 2019
yes, but i wonder if there are other more convinent ways...
KSSV
KSSV el 21 de Mayo de 2019
YOu have any limit on x and y?

Iniciar sesión para comentar.

 Respuesta aceptada

Alex Mcaulley
Alex Mcaulley el 21 de Mayo de 2019
If you have symbolic toolbox:
syms x y
eqn = x.^2+(3/2*y-sqrt(abs(x)))^2 == 3;
z(x) = solve(eqn,y);
xrand = rand(1,100); %Some random numbers
yrand = cell2mat(cellfun(@double,z(xrand),'UniformOutput',false));

Más respuestas (0)

Categorías

Más información sobre Mathematics en Centro de ayuda y File Exchange.

Productos

Preguntada:

el 21 de Mayo de 2019

Comentada:

el 21 de Mayo de 2019

Community Treasure Hunt

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

Start Hunting!

Translated by