Convert 1d data 2d surface plot
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
I am trying to study the intensity pattern of a circular light source. For that, I have a 1-d data of light intensity along a line that follows a gaussian pattern. Now, I want to convert this 1d information to a surface intensity diagram, based on spherical symmetry of the light source. In spherical coordinates - for theta is varying from 0 to 2*pi,and the intensity can be considered as a function of rho.
if true
% code
I am not able to form the corresponding meshgrid for the same. I code I used is -
phi = linspace(0,pi/2,24);
theta = linspace(0, 2*pi,24);
[theta,phi] = meshgrid(theta,phi);
rho = [1.204, 1.5307, 1.8, 2.2, 3.1, 5.2, 9.8, 16.1, 24.0, 31.2, 38.4, 41.8, 39.5, 33.3, 25.6, 17.9, 12.3, 8.2, 4.9, 3.4, 2.4, 2.4, 1.7, 1.9];
rho = meshgrid(rho);
[x,y,z] = sph2cart(theta,phi,rho);
surf(x,y,z)
end
0 Kommentare
Antworten (0)
Siehe auch
Kategorien
Mehr zu Surface and Mesh Plots finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!