You do not need a loop, it is much faster to generate all of the random values at once and assign them using indexing:
>> TempChromosomeTest = zeros(1,30);
>> TempChromosomeTest(1:3:end) = randi([1,4],1,10); % firsts
>> TempChromosomeTest(2:3:end) = randi([0,9],1,10); % seconds
>> TempChromosomeTest(3:3:end) = randi([0,9],1,10); % thirds
And you can check them using indexing too:
>> TempChromosomeTest(1:3:end) % firsts
ans =
3 1 1 4 2 1 3 1 3 1
>> TempChromosomeTest(2:3:end) % seconds
ans =
9 8 4 3 9 1 2 3 7 4
>> TempChromosomeTest(3:3:end) % thirds
ans =
6 6 0 2 4 0 2 4 2 7