Here you can download the zip file that contains all files that are necessary for running the different programs:
matlab.zip
bragg_planes.m
bragg_scattering1.m
ewald.m
I_teta_graph_func.m
rotate1.m
scanning_angles_func.m
triangle.m
two_waves.m
vector4.m

## Matlab functions related to the page "introduction"

### two_waves :

This function plot 2 wave in relative phase and their sum
Type in the command window:
two_waves(angle)
The function argument:
angel - the relative phase in degrees

## Matlab functions related to the page "bragg scattering":

### scanning_angels_func

This function scans angles for selected bragg plane
Type in the command window:
scanning_angles_func(h,f,d_teta,final_teta)
The function arguments:
h,f - components of G vector (for G=(1,2) : h=1 , f=2)
d_teta - the intervals between each angle (in degrees)
Example: if you want to see visualization of direction G=(1,1) from 10o to 80o in intervals of 10o write in command window :
scanning_angels_func(1,1,10,10,80)

### I_teta_graph_func :

This function plots graph of I vs. θ
Type in the command window:
I_teta_graph_func(d,λ)
the function arguments:
d - the distance between two bragg planes
λ - the wavelenght of the diffracting wave
Example: if you want to see plot of direction d=3 and λ=2 write in command window :
I_teta_graph_func(3,2)

## Matlab functions related to the page "ewald construction"

### ewald:

This function scans Bragg planes for different wave numbers k Type in the command window:
ewald(k)
The function argument:
k- the wave number (k=2*π/λ)
Example: if you want to see visualization of scanning G vectors for k=5 type in the command window :
ewald(5)

All the programs are functions in matlab so in order to operate them you need to:

### Windows:

1. open the zip file in yours matlab work directory
2. write in the matlab command window the appropriate function with the right arguments