I followed the standard procedure to execute .m file from the bash shell which is by adding #! /usr/local/bin/octave -qf at the beginning of the file and set the permissions of the file to 755. When I executed ./<name of the function / .m file>, it did not work. The .m file contains several sub functions that are internally used for the overall execution. I also tried using octave <name of the .m file> but it gives an error that displays "nested functions not implemented in this context".
I am able to execute the .m file if I use it from the octave shell and as well as the octave gui.
Can I kindly know the procedure to execute .m files from the bash shell?
If that doesn't work, then just executing the file won't work either.
About nested functions: I don't use them, so I'm no authority, but I've heard that functions defined in scripts may not be nested. If that's so, you could solve that problem by removing your nested function to a separate function file.