MATLAB: Matrix issue with null

matrixnull

Hello, i have this code in mathematica and i want to do it in matlab:
T = Table[{Null, Null}, {Maxstep}]
t = Table[Null, {Maxstep}]
T2 = Table[{0, 0}, {Maxstep}]
How can i do it?(the null?) Thanks!
EDIT—->> Also,this : ml = Table[If[RandomReal[] < 0.5, 1, -1], {L}, {L}];
I tried this: ml=rand(L,L); if rand()<0.5 ml(:,:)==1 else ml(:,:)==-1 end ml
but it gives me random numbers 0-1 and i want only 1 and -1

Best Answer

If you want a 2-by-|Maxstep| table of nulls, you can do
T = NaN(2,Maxstep);
This way, T will be numeric. Otherwise, go with Matt Fig's suggestion of a cell array of empty arrays.
Related Question