Hi Frank,
Sure I can do that, but then I can't apply the function as constantmatrix is not defined.
Maybe I wasn't clear about the code I need. I want the list to show "constantmatrix" unevaluated (because in reality constant matrix will be a large matrix and list will be really long), yet for the function to work:
In[7]:= Clear[constantmatrix]
list = {#, # + 1, constantmatrix} & /@ Range[5]
Out[8]= {{1, 2, constantmatrix}, {2, 3, constantmatrix}, {3, 4,
constantmatrix}, {4, 5, constantmatrix}, {5, 6, constantmatrix}}
This is fine. Now if I define constant matrix and examine list:
constantmatrix = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9};
In[10]:= list
Out[10]= {{1, 2, {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}}}, {2,
3, {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}}}, {3,
4, {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}}}, {4,
5, {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}}}, {5,
6, {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}}}}
Then I have the constantmatrix repeated in list - I want to avoid this - because the actual constantmatrix is very large and list size (which come from Range[x] is also very long). Hence list might blow up which I want to avoid.