How do I minimise a function that has a vector output?

조회 수: 3 (최근 30일)
Matt Lilley
Matt Lilley 2018년 7월 6일
편집: Stephen23 2018년 7월 14일
Hello. I have a function with six input angles, and outputs a 1x6 vector. The plan is to subtract this from another 1x6 vector to make an "error" vector to minimise. I understand from the literature that fminsearch and similar functions all have a scalar output. Basically, I would like to know if there is a function that changes the input angles to minimise all six elements in the output error vector? Thanks!

답변 (1개)

Stephen23
Stephen23 2018년 7월 6일
편집: Stephen23 2018년 7월 6일
"I would like to know if there is a function that changes the input angles to minimise all six elements in the output error vector?"
Add weighting to the error values if required (e.g. square the values), then sum them. Minimize the sum. Any "minimizing of the vector" will ultimately be exactly equivalent to this, so that is the solution. You could use lsqnonlin (which requires a vector output from the cost function), but note that this implicitly sums the squares of the vector, so it amounts to exactly the same thing.
  댓글 수: 5
Matt Lilley
Matt Lilley 2018년 7월 9일
Something like this I guess: https://uk.mathworks.com/help/gads/pareto-front-for-two-objectives.html
Stephen23
Stephen23 2018년 7월 13일
편집: Stephen23 2018년 7월 14일
"The "minimisation" I have in mind is the process of finding the values of the variables/unknowns such that the values in ALL elements in the array are the smallest."
Add weighting as required. Sum the squares, or use min. Minimize that scalar. It amounts to exactly the same thing (which is why minimizing a scalar is all you need).

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Mathematics에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by