How can i plot this equation using surface plot in Matlab?
7 views (last 30 days)
Show older comments
I want to plot the equation in attached picture. I will be appreciated if anybody help me . Coefficients are W=0.34*10^-3 Lambda=0.15*10^-6 t=400*10^-9 j0=1
0 Comments
Accepted Answer
Voss
on 13 Feb 2024
W=0.34e-3;
Lambda=0.15e-6;
t=400e-9;
j0=1;
x = linspace(-W/2,W/2,100);
jxy = NaN(1,numel(x));
idx = abs(x) < W/2-Lambda^2/t;
jxy(idx) = j0./sqrt(1-(2*x(idx)/W).^2);
jxy(~idx) = j0*sqrt(W*t)/(2*Lambda);
NY = 100; % Note: the choice of y is arbitrary, as j(x,y) does not depend on y
surf(x,1:NY,jxy(ones(1,NY),:),'EdgeColor','none')
colorbar
More Answers (0)
See Also
Categories
Find more on Surface and Mesh Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!