o_source: Sourcing Octave/Matlab Files

Description Usage Arguments Value Octave Documentation for source See Also Examples

View source: R/base-functions.R

Description

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

Usage

1
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 o_eval.

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 source

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

[Generated from Octave-\Sexpr{RcppOctave::o_version()} on \Sexpr{Sys.time()}]

See Also

Other Octave_files: o_addpath, o_inpath

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# 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')

RcppOctave documentation built on May 29, 2017, 11:31 a.m.