The lecturer gave us an initial file with the relevant code in it and we had to modify certain parameters and see how that affected the output.

The one that is giving me grief is turning the one basis lattice into a two basis lattice.

The original code to create the lattice was "c=c+atom(x.-n*a,w)", where x essentially represents the x axis and c the y axis. w is a variable to determine the type of atom in each basis, a is the lattice constant and n is related to the number of atoms in the crystal. The question says "Put two identical atoms in each cell, n_at(x; w=16)+n_at(x-1/3;w=16)"

So my attempt was to replace the above code with: "c=c+atom(x.-n*a,w)+atom(x.-n*a-1/3,w)"

But to no avail. I'm not sure what I'm doing wrong, but if anyone could give me a push or perhaps suggest somewhere where I can find help on this (the Octave website wasn't much use) I'd be greatly appreciative.