drawing gaussian wave in matlab

5 次查看(过去 30 天)
Yasemin
Yasemin 2023-4-7
How can I plot a 2D profile of a red laser beam (λ = 600 nm) with a beam-waist of 0.5 mm that is in z-y or z-x plane, where z (0<z<20 m) ) is the propagation direction?
  3 个评论
Yasemin
Yasemin 2023-4-7
yes, travels a distance of 20 meters.

请先登录,再进行评论。

回答(1 个)

Image Analyst
Image Analyst 2023-4-7
Try this:
% Optional initialization steps
clc; % Clear the command window.
close all; % Close all figures (except those of imtool.)
clear; % Erase all existing variables. Or clearvars if you want.
workspace; % Make sure the workspace panel is showing.
format long g;
format compact;
fontSize = 18;
% Define how many elements you want along your z axis,
% which runs from 0 to 20.
numElements = 2000;
z = linspace(0, 20, numElements);
% Define z0 as something. (It's not z(0) which has a value of zero.
z0 = 5;
% Define w0 as something.
w0 = 3;
w = w0 * sqrt(1 + (z / z0) .^ 2);
% Plot w vs z
plot(z, w, 'b-', 'LineWidth', 3);
grid on;
title('Beam Waist Diameter as a Function of z', 'FontSize', fontSize);
xlabel('z [meters]', 'FontSize', fontSize);
ylabel('Waist Diameter [meters?]', 'FontSize', fontSize);
g = gcf;
g.Name = 'Demo by Image Analyst for Yasemin';
g.NumberTitle = 'off';
g.WindowState = 'maximized'
  2 个评论
Yasemin
Yasemin 2023-4-7
thank you, this explanation was a clue to solve my question
Image Analyst
Image Analyst 2023-4-7
You're welcome.
If this Answer solves your original question, then could you please click the "Accept this answer" link to award the answerer with "reputation points" for their efforts in helping you? They'd appreciate it. Thanks in advance. 🙂 Note: you can only accept one answer (so pick the best one) but you can click the "Vote" icon for as many Answers as you want. Voting for an answer will also award reputation points.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Grid Lines, Tick Values, and Labels 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by