How a solution depends on a variable
Show older comments
I have a function UE=Explicit(S,sigma,r,T,M,K,gamma,N); and I want to plot how the solution depends on gamma where 0.5<=gamma<=1. All of the other parameters are constants. How can I do this?
Accepted Answer
More Answers (1)
John D'Errico
on 17 Sep 2019
Using gamma as the name of a variable is a bad idea. Regardless,...
Where is the problem? Just substitute a range of values for gamma. Save the solution for each gamma. Then plot, with gamma on the x axis, and your solution on the y axis. WTP?
You can even use tools like fimplicit, which will do the hard work for you. For example,
f = @(gam,y) gam.^2 - y.^2 - 2*gam.*y.^3 + gam.*y + 1;
fimplicit(f)
xlabel 'gam'
ylabel 'y'
grid on

1 Comment
Amanda Hoxell
on 17 Sep 2019
Categories
Find more on Interactive Control and Callbacks in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


