Skip to main content
7-Bedrock
December 28, 2023
Question

Function and vector inputs

  • December 28, 2023
  • 2 replies
  • 826 views

I want to solve a function based on column of vector inputs how can I achieve this? I want to define a specific function then solve it by providing a variable that contains values in form of columns.

2 replies

23-Emerald IV
December 28, 2023

Please provide a worksheet with (an example of) what you are trying to do.

State the version of Prime you are using.

 

Success!
Luc

25-Diamond I
December 28, 2023

I agree with Luc that an example sheet which shows what you actually are trying to achieve would be necessary for further help.

 

Here just a shot in the blue

 

Lets assume you want to solve the equation (you can't solve a "function"!)

Werner_E_0-1703803808187.png

for c, input values are a and b and you want to solve it for a couple of a- and b- values which you provide as vectors.

 

One way could be to symbolically solve the equation and turn the result into a function sol1( ) of a and b.
Then you call that function with the vectors as arguments (you should use vectorization when you do so).

Werner_E_1-1703803945504.png

 

Another way is to use the numeric root function in a similar way

Werner_E_2-1703804008567.png

 

For further help attach a worksheet with some examples