This is simplified but take as an example the following MATLAB function handle:
F = @(x)[x(1)-x(2);x(2)-x(3)]
The system has of course has many solutions. Is it possible to obtain a solution for a function like this one after substituting at least one variable? For example, substituting x(3)=1
the function would become:
G = @(x)[x(1)-x(2);x(2)-1]
And a solution for the other variables can be obtained. I use fsolve
and it works quite well for the system of equations I have. Of course what I need to do can be done using the Symbolic Toolbox, but calling it in a big for loop makes it too slow to use for my code.
I'm trying to come up with some code that can return G
given F
and a set of indices in x
to replace with given values.