Matlab2 Matlab으로 fcc 3d frame 만들기 % Define the parameters n = 100; % number of atoms a = 0.5; % lattice parameter L = ceil(n^(1/3))*a; % total size of the cubic frame % Generate the FCC lattice points [x,y,z] = meshgrid(0:a:L-a); xyz = [x(:) y(:) z(:)]; xyz_odd = xyz(mod(sum(floor(bsxfun(@rdivide, xyz, a)), 2), 2) == 1,:); xyz_even = xyz(mod(sum(floor(bsxfun(@rdivide, xyz, a)), 2), 2) == 0,:); FCC_points = [xyz_odd; xyz_even]; %.. 2023. 2. 25. Matlab으로 원 그리기 r = 5; % radius of the circle in cm theta = linspace(0, 2*pi, 1000); % create 1000 points evenly spaced around the circle x = r*cos(theta); % x-coordinates of the circle points y = r*sin(theta); % y-coordinates of the circle points plot(x, y); % plot the circle axis equal; % set the aspect ratio to 1:1 title('Circle with Radius 5 cm'); % set the title xlabel('x (cm)'); % set the x-axis label yla.. 2023. 2. 24. 이전 1 다음