MATLAB Answers

fsolve - function with two input arguments

7 views (last 30 days)
Ignacij
Ignacij on 29 Jan 2020
Answered: Ignacij on 2 Feb 2020
Hello!
Is it possible to solve function with two input arguments? I have function in which I input two parameters and it returns one.
Example:
x = function(a,b)
x.JPG
But now i have a problem. I know parameters x and a, how do I get parameter b? Is it even possible?
Thanks for your reply!

  0 Comments

Sign in to comment.

Accepted Answer

Jeff Miller
Jeff Miller on 30 Jan 2020
function b = find_b(knownX, knownA, guessForB)
fun = @(b) pfun2(knownA,b) - knownX;
b = fzero(fun,guessForB);
end
Depending on your pfun2, you may or may not need a guessForB that is close to the right value.

  0 Comments

Sign in to comment.

More Answers (1)

Ignacij
Ignacij on 2 Feb 2020
Thank you!

  0 Comments

Sign in to comment.

Sign in to answer this question.