How to plot a two variable function?

조회 수: 1 (최근 30일)
Soto Alejandro
Soto Alejandro 2020년 1월 22일
댓글: Star Strider 2020년 1월 22일
I'm working with some multi-objective optimization and I've found some toolkits for that. To decide on which one to use I'm testing them with different trivial problems like the optimization of a can. But I´ve found that a commonly used problem to test them is this one
n=numel(x);
z=[1-exp(-sum((x-1/sqrt(n)).^2))
1-exp(-sum((x+1/sqrt(n)).^2))];
and it will be really useful for me to see a graphical representation of that function, but I'm struggling to plot it. Any advice is appreciated

답변 (1개)

Star Strider
Star Strider 2020년 1월 22일
Apparently ‘x’ is a vector. That means that ‘z’ produces only two values.
You could plot it as:
figure
plot(z, 'p')
however I doubt if that is going to be very meaningful.
  댓글 수: 1
Star Strider
Star Strider 2020년 1월 22일
That is all there is.
The result returned in ‘z’ for that ‘x’ is:
z =
1.0000
1.0000
It is only a point.

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

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by