MCPcopy Create free account
hub / github.com/daniel-e/rustml / add_vector

Method add_vector

src/octave.rs:110–116  ·  view source on GitHub ↗

Adds the string to the Octave script. At the end of the line a semicolon is appended. If the string contains two consecutive dollar signs (i.e. `$$`) these will be replaced by a vector containing the elements of `vals`. # Example ``` # extern crate rustml; use rustml::octave::*; # pub fn main() { let s = builder().add_vector("x = $$", &[1, 2, 3]); assert_eq!( s.to_string(), "1;\nx = [1,2,3];\n

(&self, s: &str, vals: &[T])

Source from the content-addressed store, hash-verified

108 /// # }
109 /// ```
110 pub fn add_vector<T: fmt::Display>(&self, s: &str, vals: &[T]) -> OctaveScriptBuilder {
111
112 let mut t = s.to_string();
113 let v = self.to_vec(vals);
114 t = t.replace("$$", &v);
115 self.add(&t)
116 }
117
118 /// Adds the string to the Octave script.
119 ///

Callers 5

plot_learning_curveFunction · 0.80
add_vector_iterMethod · 0.80
mainFunction · 0.80
mainFunction · 0.80
plot_nnFunction · 0.80

Calls 3

to_stringMethod · 0.80
to_vecMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected