https://kasata.medium.com/how-to-resolve-undefined-function-or-variable-x-error-in-matlab-d03cd3e2aac0