Filter löschen
Filter löschen

Making tilted and rotated periodic 2D arrays

1 Ansicht (letzte 30 Tage)
태신 김
태신 김 am 12 Apr. 2022
I'm studying DMD(digital micromirror device) mirror.
I made the tilted rhombic(45 degrees rotated square around the Z-axis) 2D arrays with rect function.
function[out] = rect(x);
out = abs(x)<=1/2;
end
clc; clear all; close all;
##
wx=0.9; %rect x half-width (m)
wy=0.9; %rect y half-width (m)
L=1; %side length x&y (m)
M=100; %samples/side length
dx=L/M; %sample interval (m)
x=-L/2:dx:L/2-dx; %x coordinates
y=x; %y coordinates
[X,Y]=meshgrid(x,y); %X and Y grid coords
DMDshape=rect(X/wx).*rect(Y/wy); %signal
##
Xlist = reshape(X,1,M^2);
Ylist = reshape(Y,1,M^2);
Zlist = reshape(DMDshape-1,1,M^2);
##
ListSet = [Xlist; Ylist; Zlist];
RotListSet =rotx(12)* rotz(45)*ListSet;
plot3(ListSet(1,:),ListSet(2,:),ListSet(3,:),'.b');
axis tight
hold on
plot3(RotListSet(1,:),RotListSet(2,:),RotListSet(3,:),'.r');
axis([-1, 1, -1, 1, -0.5, 0.5]);
(one cell)
With this, I want to make m by n copied array as below.
(cell arrays)
Could you give me some help?

Antworten (0)

Kategorien

Mehr zu Language Fundamentals finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by