I know you asked for something else, but I could not resist showing you how simple it is to do such things with asympote. If you compile
\documentclass[border=3.14mm]{standalone}
\usepackage{asypictureB}
\begin{document}
% code essentially from https://tex.stackexchange.com/a/141478/121799
\begin{asypicture}{name=particles}
import three;
settings.render=8;
settings.prc=false;
settings.outformat = "pdf";
size(10cm);
currentprojection = orthographic((3,4,5));
material cylcolor = material(diffusepen=gray(0.9), ambientpen=gray(0.9));
real cylRadius = 0.1;
real sphereRadius = 0.1;
void drawRod(triple a, triple b) {
surface rod = extrude(scale(cylRadius)*unitcircle, axis=length(b-a)*Z);
triple orthovector = cross(Z, b-a);
if (length(orthovector) > .01) {
real angle = aCos(dot(Z, b-a) / length(b-a));
rod = rotate(angle, orthovector) * rod;
}
draw(shift(a)*rod, surfacepen=cylcolor);
}
void drawSphere(triple center) {
draw(shift(center)*scale3(sphereRadius)*unitsphere, surfacepen=cylcolor);
}
void drawParticle(triple endA, triple endB){
drawSphere(endA);
drawSphere(endB);
drawRod(endA,endB);
}
drawParticle(O,0.5X);
drawParticle(Z,Z+0.5(X+Y)/sqrt(2));
drawParticle(2Z,2Z+0.5Y);
\end{asypicture}
\end{document}
with pdflatex -shell-escape, you'll get

I do not know the algorithm to place these things, but I can't imagine it will be hard to implement it in asymptote, or to let matlab write the relevant data into a piece of asymptote code.