Here is the general structure of how you could create a loop that will allow you to plot your function using fsolve
with multiple independent variables -
main.m1207 chars38 lines
Note: You will need to specify the ranges for the independent variables (x_val_range, y_val_range, z_val_range) and the initial values for starting the function (x_val, y_val, z_val). These values will depend on your specific function!
One way to choose values for the ranges is using linspace
- this will create equally spaced values between a range that you specify. For example, x_val_range = linspace(0,10,100)
, will create a vector of 100 values between 0 and 10.
Also note that it's a good idea to specify bounds for each independent variable using lb
and ub
, so that fsolve
doesn't go outside of the desired search space.
gistlibby LogSnag