Next: geometry, Previous: file-handling, Up: Directory Index [Contents][Index]
name
)name
)Sets or retrieves the value of a named CPU time counter.
cputic("__test");
name
) ;Prints the elapsed CPU time since a named CPU time counter was set.
cputic("__test"); cputoc("__test");
Sets and/or returns the OctApps debug level level.
assert(DebugLevel() == 0); DebugLevel 1; assert(DebugLevel() == 1); DebugLevel(2); assert(DebugLevel() == 2);
If DebugLevel()
>= level, then print args… using
fprintf()
to stdout.
DebugLevel(1); DebugPrintf(0, "Hi there\n");
Returns the name of the currently executing function.
Return getfield (S, …), if it exists, otherwise return def.
assert(getoptfield(1, []), 1)
assert(getoptfield([], struct("a", 1), "a"), 1)
assert(getoptfield([], struct("a", 1), "b"), [])
Returns whether the calling Octave script is being run from an interactive session, as opposed to from the command line. If calling function is not a script, return empty.
assert(isInteractive());
Converts its arguments from foreign objects (e.g. SWIG-wrapped objects) to native Octave objects, if possible. Native objects are passed though.
assert(isscalar(native(rand())))
Backwards compatible replacement for ’octave_config_info()’ function, which in newer octave versions has been renamed to ’__octave_config_info__()’ see https://octave.org/doc/v6.4.0/Obsolete-Functions.html#Obsolete-Functions
octapps_config_info();
Prints a progress message at decreasing intervals, displaying the number of tasks completed, CPU usage, time elasped/remaining
prog = []; for i = 1:5000 for j = 1:5 doSomeTask(i, j, ...); prog = printProgress(prog, "inner loop", [i, j], [5000, 5]); endfor prog = printProgress(prog, [i, j], [5000, 5]); endfor
Generic code-running driver: run code, passing any command-line options in the struct params, which are passed to code in —name=val format. Use params.LAL_DEBUG_LEVEL to set the LAL debug level. If verbose is true, print command before running it.
runCode(struct("c", 'echo "This is a test of runCode()"'), "/bin/sh");
Return the struct S with its fields sorted alphabetically.
S1 = struct('name', {'Peter', 'Hannah', 'Robert'}, 'age', {23, 16, 3}); S2 = sortStructFields(S1); assert(all(strcmp({S1.name}, {S2.name}))); assert(all([S1.age] == [S2.age]));
Aaargh Octave! At startup it prepends PATH with directories containing Octave executables - which if it’s installed in /usr/bin include /usr/bin. This will clobber any existing paths in PATH that were meant to override /usr/bin, such as e.g. custom installation of LALSuite!
This script undoes the damage.
unmanglePATH();
Next: geometry, Previous: file-handling, Up: Directory Index [Contents][Index]