I have some sample code:
constantmatrix = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}}
f[a_, b_, constant_] := a + b + Plus @@ Flatten[constant]
I then want to enter some parameters in to the function. The following works:
list = {#, # + 1, constantmatrix} & /@ Range[5]
Apply[f , list, 1]
However I want list to just show "constantmatrix" rather than the matrix values. So the following code does not work, but is in the spirit of what i want to do:
list = {#, # + 1, "constantmatrix"} & /@ Range[5]
Apply[f , list, 1]
Although the "list" looks okay, since it's a String - i can't get it in to the function. Any help on this would be appreciated!
{{1, 2, "constantmatrix"}, {2, 3, "constantmatrix"}, {3, 4,
"constantmatrix"}, {4, 5, "constantmatrix"}, {5, 6,
"constantmatrix"}}