From the course: Processing: Interactive Data Visualization

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

Modifying arrays

Modifying arrays - Processing Tutorial

From the course: Processing: Interactive Data Visualization

Start my 1-month free trial

Modifying arrays

In our last movie, we learned how to create arrays of data, that is, a collection of data points that are all of the same variable type such as ints, floats, but getting an entire collection you're can to refer to as a single thing. In this one, I want to show you how to work with arrays and perform a handful of different functions on them. I'm going to start by naming my file here, just as a comment in my own file, and then I'm going to create an array. It's going to be integer variables and I put the square brackets to indicate that it's an array. Give it a name, I'll just simply call this one 'a', and then I'm going to put in curly brackets {7, 0, 4}, and those would be the three values that are going to be in my array. We can double-check that and you'll see that the 7, 0, and 4 appear at the bottom with their index numbers 0, 1, and 2, great. The next thing I want to do though is I want to copy this array. Now one way to do this, is to create an empty array, also of integer…

Contents