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

Method add_vector_iter

src/octave.rs:139–143  ·  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 iterator `vals`. # Example ``` # extern crate rustml; use rustml::octave::*; # pub fn main() { let v = vec![1, 2, 3]; let s = builder().add_vector_iter("x = $$", v.iter()); assert_eq!(

(&self, s: &str, vals: I)

Source from the content-addressed store, hash-verified

137 /// # }
138 /// ```
139 pub fn add_vector_iter<T: fmt::Display, I: Iterator<Item = T>>(&self, s: &str, vals: I) -> OctaveScriptBuilder {
140
141 let v = vals.collect::<Vec<_>>();
142 self.add_vector(s, &v)
143 }
144
145 /// Adds the string to the Octave script.
146 ///

Callers 2

mainFunction · 0.80
plot_nnFunction · 0.80

Calls 1

add_vectorMethod · 0.80

Tested by

no test coverage detected