To answer your questions:
- Did you create the column-matrix correctly? Sure. It works :). There are many ways to create matricies. The way you have done it is an acceptable way. A few other ways to make a vector:
kg = linspace(1,2,2)
kg = 1 : 1 : 2;
kg = [1;2];
2. Should you create a random set of weights with a+(b)*rand(1,2)? Sure! Remember that you will have to declare your variables a and b but that will work. This will give you a 1x2 matrix again, if you wanted to start with a 2x1 matrix (so you don't have to transpose with ', you can just use rand(2,1)).