|
![](/i/fill.gif) |
Wasn't it Mike who wrote:
>Hi.
>I am trying to create a random phase within a sine function, but keep
>getting an
>error that a 'function identifier' is expected and I do not understand why.
If you think about it, there's a pretty good reason why you can't use
RAND inside a function. Imagine what happens when the code tries to
solve such a function. The solver attempts to approach a solution by
finding a series of points on each side that get nearer and nearer to
the solution. If the function contains RAND, then the function is
discontinuous everywhere, and that approach doesn't home in on a
solution.
What you can do is write a macro instead of a function. You'll need to
write your own loop to perform the sum() operation.
--
Mike Williams
Gentleman of Leisure
Post a reply to this message
|
![](/i/fill.gif) |