- #1
MAKK
- 4
- 0
anyone help me to convert this sample code of Gaussian Cone shape of random number code in Matlab into C++
Matlab:
function GaussianCone
clear all; clc;
mx=10000; my=mx; mz=mx;
z=[1:1:mz]';
sigma=0.01; R=0.5; mu=0;
sigmax=sigma+R*z;
sigmay=sigma+R*z;
x=zeros(mx,1); y=zeros(my,1);
for i=1:mx
x(i)=normrnd(mu, sigmax(i));
end
for j=1:my
y(j)=normrnd(mu, sigmay(j));
end
size(x)
size(y)
size(z)
plot3(x,z,y,'.r')
end
Last edited by a moderator: