cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X

Function and vector inputs

OM_10154742
6-Contributor

Function and vector inputs

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 2
LucMeekes
23-Emerald III
(To:OM_10154742)

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

State the version of Prime you are using.

 

Success!
Luc

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

 

Top Tags