if you type ??
on name of any command, Mathematica will tell you its properties. Look for Listable
. If it is there, this means you can pass a list to the function, and it will act on the whole list.
?? Log
Attributes[Log] = {Listable, NumericFunction, Protected}
Since Log
is listable, then just do
a = {1, 2, 3, 4, 5};
Log[a]
(*{0, Log[2], Log[3], Log[4], Log[5]}*)
If the command is not listable, you can always map the function on the list, like this
Log[#] & /@ a