Sir, i have a vector consisting of 112 information symbols,can we write a statement in MATLAB like b=randi(112,1)-1 ,Is the way to write a code correct or not?

The syntax for randi command is

1 |
X = randi(imax,m,n) |

This will generate a mxn matrix with random numbers from 1 to imax

If you have information symbols that should start from 0, use

1 |
X = randi(imax,m,n)-1 |

So to have a vector of 112 information symbols (112×1 matrix) that can take any number in the range say 0 to 49, use

1 |
X = randi(50,112,1)-1 |

Check the command documentation

*×*