dimanche 11 juillet 2021

How to generate a random number in Matlab, to havea good scatter distribution?

I want to generate random numbers in matlab to have a nice distribution, but, I got only a line...

I tried with random('HalfNormal',500,500), with random('Binomial',50,rand(1,1)); and random('Logistic',0,0.1); but I only got something like this:

The line dsitribution, which is bad to me

But I need something like this:

enter image description here

How can I do this?

UPDATE: My data generator code, for the part one of the data:

R_i = 750;
R_0 = 7500;
t   = 0.75;
a   = 0.75;

for i = 1:500
    R_i   = R_i + random('HalfNormal',50,15);
    R_0     = R_0 + random('HalfNormal',500,500);
    %here is my data
    [output] = ComplexChanger(R_i,R_0,t,a,random_complex_dataset);
    %from here I can save to file or anything using the mean(abs(real(output))) and mean(abs(imag(output))), so I can generate a number from all of it, which means this is much more randomized
end

function [output] = ComplexChanger(R_i,R_0,t,a, random_complex_dataset)
    output = R_i+(R_0-R_i)./(1+(sqrt(-1).*xdata.*t).^a); %here I change the complex data with a basic Cole stuff, which is ideal to manipulate complex number, which are good to have a two dimensional vector.
end



Aucun commentaire:

Enregistrer un commentaire