I am simulating a spot of a Gaussian laser beam. I've added my simple code below. It creates three figures: one plot of the Gaussian spot itself, and two plots of the histograms of the vertical coordinates and horizontal coordinates. What I would like to do is create one figure with these three plots, with the histograms along their corresponding axes. I've added an example of this below that I created by combining the figures in MS Paint.
I would like to create this picture in MATLAB instead, does anyone know if this is possible? If yes, how?
Thank you in advance.
M2 = 1.45;
lambda = 800E-9;
w_init = 0.010;
sigma_pos = w_init/2;
Nrays = 10000;
sigma_posy = sigma_pos/sqrt(2);
sigma_posz = sigma_posy;
qy0 = normrnd(0, sigma_posy, 1, Nrays);
qz0 = normrnd(0, sigma_posz, 1, Nrays);
plot(qz0, qy0, 'b.')