Is it possible to create sections in Octave Script like in Matlab?
This is a great functionality since it enables the user to debug scripts in parts. In Matlab sectioning is achieved by using two % symbols like in the example:
%%
% Section 1
%%
% Section 2
Is there such an option in Octave? Any suggestion to perform the same behavior?
Blocks of code delimited by %% do not exist in the Octave programming language. If you use the Octave GUI, then you can select that block manually and "run selection".
Depending on how you want to use those blocks, a better solution would be to write functions (note that in Octave you can define functions in the script and at the command prompt). After all, you are splitting your code into units to run separated from others, and that sounds like functions to me.
You can also use Jupyter with an octave kernel. And you can wait for a future version of Octave to include that feature (faster if you help).
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