I want to run a function - let's say test - inside my test.m file. I want to run this function using Octave from terminal. So, it should be something like:
$>/Users/me/octave/bin/octave test(param1,param2)?
How can I accomplish this? I can do that in Matlab. But I didn't find a way in Octave.
You can use octave --eval CODE
Octave's docs on this can be found here. To run a function with input args:
cd to your working directory.octave to open an interactive session.ls to check that your function's file is in your working dir, cd to the dir if not.>foo(100). Your function will then run, spitting out whatever you print as well as all the results for lines of code not ending with ;.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With