%% Rajni Chahal (rajni.chahal@mavs.uta.edu), PhD Student, UT Arlington % Dr Ashfaq Adnan, Dr Ajit Roy %% July 20, 2016 % Please contact for any help in code n=100; % number of fibers L=400; % x-dimension of RVE M=300; % y-dimension of RVE l=L/10; % length of fiber r1=0.5; %radius of CNTs/fibers d1=2*r1; axis([0 L 0 M]); ax=gca; th=[]; XX=[]; YY=[]; for i=1:n x=rand*L; y=rand*M; t=rand*2*pi; th=[th;t]; X=[x-(l/2)*cos(t) x+(l/2)*cos(t)]; Y=[y-(l/2)*sin(t) y+(l/2)*sin(t)]; figure(1); line(X,Y,'Color',[0 0 0],'LineWidth',d1); % to generate thin fibers, put 1 in place of d1 axis off set(gca,'units','pixels','position',[50 50 L M]); end