Page tree
Skip to end of metadata
Go to start of metadata

Using matlab scripts in extractors can present a challenge because matlab requires a license. Additionally, matlab is still frequently used in the scientific community, and many labs and research groups have legacy code from authors who are no longer available to translate to other languages. 

Octave (https://www.gnu.org/software/octave/) is open source and can run matlab scripts.

Below is a Docker file that installs octave, as well as several commonly used dependencies.


# sample dockerfile
# installs octave and necessary packages

FROM ubuntu

USER root

RUN apt-get update && \
    apt-get install -y gnuplot \
    less \
    libnetcdf-dev \
      octave \
      liboctave-dev && \
    apt-get clean

RUN octave --no-gui --eval "pkg install -verbose -forge -auto netcdf"
RUN octave --no-gui --eval "pkg install -verbose -forge -auto io"
RUN octave --no-gui --eval "pkg install -verbose -forge -auto statistics"

RUN octave --no-gui --eval "pkg load statistics"

Other useful hints:

octave uses argv() to get the command line arguments. argv(){1} being the first after the script itself, followed by argv(){2} etc.

pkg('load', 'statistics');

is how packages are loaded.
  • No labels