Octave/Storage

From Coder Merlin
< Octave
Revision as of 13:46, 31 March 2022 by Chukwuemeka-tinashe (talk | contribs) (Created page with "== Reading from a Remote URL == We can read the contents of a remote URL using the following command: {{ConsoleLine|octave:17>|s {{Equal}} urlread ("<nowiki>https://www.codermerlin.com/users/john-williams/sample.csv</nowiki>");}} == Reading from a String == We can read the contents of a string using the following command, interpreting each value read as a Double: {{ConsoleLine|octave:18>|A {{Equal}} strread(s, "%n");}} == Appending from a String == We can append the cont...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Within these castle walls be forged Mavens of Computer Science ...
— Merlin, The Coder

Reading from a Remote URL[edit]

We can read the contents of a remote URL using the following command:

octave:17> s = urlread ("https://www.codermerlin.com/users/john-williams/sample.csv");

Reading from a String[edit]

We can read the contents of a string using the following command, interpreting each value read as a Double:

octave:18> A = strread(s, "%n");

Appending from a String[edit]

We can append the contents of a string to an existing array using the following command:

octave:18> A = [A; strread(s, "%n")];