![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1407799/image.png)
Create a matrix representing the gradual-width Fermat spiral slit mask
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I would like to create a N*N matrix T = zeros(N) to represent the gradual-width Fermat spiral mask given by
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1407794/image.png)
where rho and theta are the radius and azimuth of the polar coordinates, respectively. The parameters in the above equation are
N = 1024; % space sampling points
pixSize = 14e-6; % pixel size, unit: m
x = linspace(-pixSize*N/2, pixSize*N/2, N);
y = x;
[X,Y] = meshgrid(x,y);
[THETA,RHO] = cart2pol(X,Y);
z0 = 1;
lambda = 0.633e-6;
l = 4;
rho0 = 1.4e-3;
A = 0.015e-3;
d0 = 0.02e-3;
I have a little difficulty in creating such matrix. Can someone help? Thanks a lot.
And I think it should be like this.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1407804/image.jpeg)
1 commentaire
Star Strider
le 10 Juin 2023
You want to do the opposite of this:
[THETA,RHO] = cart2pol(X,Y);
Instead, create the initial matrices in polar coordinates, then use the pol2cart function to create the Cartesian matrix, and plot it.
I will leave the creation of the ρ and θ matrices, and writing the code for
to you.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1407799/image.png)
.
Réponses (0)
Voir également
Catégories
En savoir plus sur Polar Plots dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!