https://technicalsource9.medium.com/how-can-i-write-a-level-2-matlab-s-function-where-the-input-and-output-8835bddca8e2