Thanks sir.
if someone is interested, I answer my question about using vpi in simulink (see below comment). I converted the vpi number into a matrix of bits (actually a bit is stored in double).
here are the steps :
seed = vpi('123456789')
N0 = randint(vpi(seed),[1,1])
N1 = vpi2bin(N0) % Convert vpi from decimal to binary form
N2 = [N1 - '0'] % Convert number to string (vector)
N3 = vec2mat(N2,8) % Convert vector into matrix of 8 columns.

N = vpi('123456789012345678901234567890');
vpi2bin(N)
ans =
1100011101110100100001111111101101100001101110011111000001110111001001110001111110000101011010010
I suppose in hindsight, I should have used dec2bin as the name for this.

Dear John,
I saw that you use the Miller-Rabin algorithm to test primality. considering that are known the strong pseudoprimes to the first 9 prime bases (http://arxiv.org/pdf/1207.0063.pdf), I suggest a little implementation to speed up your Miller-Rabin algorithm:
if N<2047
witnesses=2;
elseif N<1373653
witnesses=[2 3];
elseif N<25326001
witnesses=[2 3 5];
elseif N<3215031751
witnesses=[2 3 5 7];
elseif N<2152302898747
witnesses=[2 3 5 7 11];
elseif N<3474749660383
witnesses=[2 3 5 7 11 13];
elseif N<341550071728321
witnesses=[2 3 5 7 11 13 17 19];
elseif N<3825123056546413051
witnesses=[2 3 5 7 11 13 17 19 23];
else
witnesses=[2 3 5 7 11 13 17 19 23 29 31 37];
end
Regards

Comment only