How do you correlate 2 unique inputs to the 3 outputs given?
3 views (last 30 days)
Show older comments
If I have a system with 2 influencing inputs (e.g. i1 & i2) and a combination of these two inputs will provide 3 outputs (e.g. o1, o2 & o3).
i.e. f(i1, i2) = [o1, o2, o3]
How can you extract the correct 2 input values that correspond with the 3 output values given?
Thanks
2 Comments
Answers (1)
OCDER
on 9 Sep 2017
Edited: OCDER
on 9 Sep 2017
Let's say a function (func) takes 2 inputs and returns 3 outputs.
function Out = func(In)
Out(1, 1) = In(1);
Out(2, 1) = In(1) + In(2);
Out(3, 1) = In(2);
Make an objective function (objfunc) that takes an input vector and returns a smaller scalar value the closer you are to the desired output (DesiredOut). Provide an initial guess for the inputs (InitGuess).
objFunc = @(I)max(abs(func(I) - DesiredOut));
Desired0ut = [1; 3; 2];
InitGuess = [1; 1];
Find the best inputs that minimizes objfunc.
BestI = fminsearch(objfunc, InitGuess)
BestI =
1
2
0 Comments
See Also
Categories
Find more on Transfer Function Models in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!