Storage

From Coder Merlin
Within these castle walls be forged Mavens of Computer Science ...
— Merlin, The Coder


Reading from a Local File[edit]

We can read the contents of a local file using the following command:

octave:16> s = fileread ("sample.csv");

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")];