how i can generate random points inside a cube?
Mostra commenti meno recenti
i want to generate rondom points inside a cube.
Risposta accettata
Più risposte (1)
humaira akber
il 15 Dic 2013
npx=12; % no. of NPs on x-axis npy=12; % no. of NPs on y-axis npz=12;
dx=1; % distance b/w two NPs on x-axis dy=1; % distance b/w two NPs on y-axis dz=1;
x(1)=dx; % first particle is at dx from y-axis y(1)=dy; % first particle is at dx from x-axis z(1)=dz; np=0; x=zeros(1,npx); for k=1:npx x(k)=k*dx; y=zeros(1,npy); for l=1:npy y(l)=l*dy; z=zeros(1,npz); for m=1:npz z(m)=m*dz; end
end
end
np=npx*npy*npz
sir how to plot cube by using this assembly please give me answer as earlier as you can please.will be waiting
Categorie
Scopri di più su Linear Algebra in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!