Clear Filters
Clear Filters

drawing gaussian wave in matlab

5 views (last 30 days)
Yasemin
Yasemin on 7 Apr 2023
Commented: Image Analyst on 7 Apr 2023
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 Comments
Yasemin
Yasemin on 7 Apr 2023
yes, travels a distance of 20 meters.
Yasemin
Yasemin on 7 Apr 2023
w(z)=w0*sqrt(1+(z/z0)^2)

Sign in to comment.

Answers (1)

Image Analyst
Image Analyst on 7 Apr 2023
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 Comments
Yasemin
Yasemin on 7 Apr 2023
thank you, this explanation was a clue to solve my question
Image Analyst
Image Analyst on 7 Apr 2023
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.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!