Octave: Difference between revisions

Jump to navigation Jump to search
mNo edit summary
Line 3: Line 3:


== Running Octave code ==
== Running Octave code ==
Consider the following example code:


{{File
{{File
Line 19: Line 20:
}}
}}


Here is a simple Slurm script that you can use to run <code>octave_2d_plot.m</code>:
{{File
{{File
   |name=octave_job_1.sh
   |name=octave_job_1.sh
Line 31: Line 33:


octave --no-gui octave_2d_plot.m
octave --no-gui octave_2d_plot.m
}}
=== Running MATLAB code ===
Octave can often be used as a drop-in replacement for running MATLAB scripts, like the <code>cosplot.m</code> example on our [[MATLAB#Running_a_MATLAB_code|MATLAB]] page:
{{File
  |name=octave_job_1.sh
  |lang="bash"
  |contents=
#!/bin/bash -l
#SBATCH --time=0-00:10
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=1
#SBATCH --mem=4000M
module load octave/5.2.0 gnuplot/5.4.2
octave --no-gui --traditional --eval "cosplot"
}}
}}
cc_staff
653

edits

Navigation menu