Learn R Programming

RcppOctave (version 0.18.1)

o_source: Sourcing Octave/Matlab Files

Description

This function sources an Octave file within the current Octave session. The loaded functions are accessible by subsequent calls of .CallOctave.

Usage

o_source(file = "", text = NULL, sep = ";\n")

Arguments

file
the path to the Octave/Matlab source file -- typically with extension ".m".
text
a character vector containing Octave statements, that are concatenated in a temporary file, which is then sourced. This argument typically enables the evaluation of multiple statements, as opposed to single statement evaluation performed by
sep
single character string added as suffix to each element of text. The concatenation of all suffixed element should form a valid Octave block.

Value

  • None

Octave Documentation for <em>source</em>

[results=rd,stage=render]{if( .Platform$OS.type != 'windows' || .Platform$r_arch != 'x64' ) RcppOctave::o_help(source, format='rd')}

[Generated from Octave-RcppOctave::o_version() on Sys.time()]

# roxygen generated flag options(R_CHECK_RUNNING_EXAMPLES_=TRUE)

o_clear()

# source file mfile <- system.file("scripts/ex_source.m", package='RcppOctave') o_source(mfile)

# pass multiple statements o_source(text="a=1;b=3;c=randn(1,5);") o_get('a','b','c')

# also works with a character vector of statements o_source(text=c("a=10;b=30;", "c=randn(1,5)", "d=4")) o_get('a','b','c', 'd')

Other Octave_files: o_addpath, o_inpath