Convert 1d data 2d surface plot
조회 수: 1 (최근 30일)
이전 댓글 표시
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
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!