knitr::opts_chunk$set(echo = TRUE)
octaveExe <- Sys.getenv("OCTAVE_EXECUTABLE")
octaveExe
## [1] "/usr/local/bin/octave"

This is cool: we can run Octave in Rmarkdown under RStudio!

On crunch, and jrmFastMacWin10 I set OCTAVE_EXECUTABLE in .Renviron to C:/Apps/Octave-5.1.0.0/mingw64/bin/octave-cli-5.1.0.exe

On jrmFastMac, I set OCTAVE_EXECUTABLE to /usr/local/bin/octave in Renviron in jrm_dotfiles. This is symlinked to .Renviron

On DebianSidWindows I set OCTAVE_EXECUTABLE to /usr/bin/octave in .Renviron

On ubuntu-bionic I set OCTAVE_EXECUTABLE to “/var/lib/flatpak/exports/bin/org.octave.Octave” in .Renviron and used

octaveExe <- Sys.getenv("OCTAVE_EXECUTABLE")

to retrieve it and pass it to the code chunk

   A=[1,2,3;4,5,6]
   [minval, row] = min(min(A,[],2));
   [minval, col] = min(min(A,[],1));
   [minval, row, col]
## A =
## 
##    1   2   3
##    4   5   6
## 
## ans =
## 
##    1   1   1