To generate equiprobable 0s and 1s,use either one:
rand(1,1000)>.5 % generate almost equiprobable 1x1000 logical array of 0s & 1s
randi([0 1],1,1000) % 1x1000 double array of almost equiprobable 0s & 1s
and to map data to 4-ary PSK,either use "pskmod" or "comm.PSKModulator"
Type this into command window to get more insight.
help pskmod % its an obsolete function
help comm.PSKModulator % new function