Skip to content

Instantly share code, notes, and snippets.

@miura
Created June 5, 2014 14:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save miura/ea763e779c7b1554c55c to your computer and use it in GitHub Desktop.
Save miura/ea763e779c7b1554c55c to your computer and use it in GitHub Desktop.
x = newArray(0);
a1 = newArray(1, 2, 3);
a2 = newArray(10, 20, 30);
//accumulate arrays in a single array
x = Array.concat(x, a1);
x = Array.concat(x, a2);
Array.print(x);
//slicing a range
x2 = Array.slice(x, 3, 6);
Array.print(x2);
Plot.create("Multiple Plot", "Time", "Ratio");
Plot.setLimits(0, 5, 0, 50);
for (i=0; i < 2; i++) {
a = Array.slice(x, i * 3, (i + 1)* 3);
Array.print(a);
Plot.add("line", a);
}
Plot.show();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment