AOA matlab code