There's an example in LRM 2.3.1, section 4.7.1:
Example 3 — Initialization of a vector variable
The analog user defined function called arrayadd adds the contents of a second array to the first.
Code: analog function real arrayadd;
inout [0:1]a;
input [0:1]b;
real a[0:1], b[0:1];
integer i;
begin
for(i = 0; i < 2; i = i + 1) begin
a[i] = a[i] + b[i];
end
end
endfunction
I can't say whether it works in all simulators.