Hello:
I'm trying to convert the following matlab code to sas iml.
do=1 to maxzeros;
matrixname[i]=0:(2^-i)-1;
end;
matrixname is a cell matrix, which corresponds to a list matrix in SAS IML. The operator ^ raises 2 to a power.
So let's say the index (i)=3. Then this code creates a matrix cell with 8 values 0,1,2,3,4,5,6,7.
I've written the following in IML so far:
nz2enum=listcreate(maxnonzeros);
do i=1 to maxnonzeros;
max=(2 ## i);
do k=1 to max;
val=k-1;
call ListSetItem (nz2enum,i,{val}); This inserts the word val. How to get it to insert the number val?
end;
end;
run listprint (nz2enum);