That's not a valid for loop - is that just to show us what the values of your arrays are? Regardless, your matlab line does have an error:
[${userdim[${u]} ${itemdim[${i}]} ${tagdim[${t}]}]
Should be:
[${userdim[${u}]} ${itemdim[${i}]} ${tagdim[${t}]}]