Function has 2 parameters but 0 were givenHi everybody,
I am trying to pass a function to the local memory space of the Parallel Assign function
It does not work because JMP tells me F has 2 parameters but 0 were given. How can I fix this?
Re: Function has 2 parameters but 0 were givenJMP passes arguments to functions by value. If I specify an argument as a variable (e.g., the variable storing the user function that you defined), it won't work. For example,
Names Default to Here( 1 );
f1 = Function( { x }, 2*x );
f2 = Function( { f, x }, 2 * f( x ) );
f2( f1, 3 );
I get the same error.
I don't know what you are trying to do but it might work if you use expressions instead of user functions.
Re: Function has 2 parameters but 0 were givenI'm answering a question that might or might not be the question you are asking: I think you've written something like this:
f=function(...);
parallel assign({ g = f }, ... )which will try to evaluate the right hand side of g=f and produce the error you mention.
Something like this will work:
parallel assign( { g = function(...) }, ... )see https://community.jmp.com/t5/Discussions/How-to-pass-a-function-to-Parallel-Assign/m-p/230728