Drawing an inverse of function

조회 수: 1 (최근 30일)
Mohamed ahmed
Mohamed ahmed 2016년 11월 29일
답변: Walter Roberson 2016년 11월 30일
how can i draw the reflection of any function such as shown in picture ?
  댓글 수: 1
John D'Errico
John D'Errico 2016년 11월 29일
Sigh. That is NOT the inverse of a function.

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

답변 (1개)

Walter Roberson
Walter Roberson 2016년 11월 30일
Supposing you have x and y as row vectors, and that the point of reflection is to be the end of the existing x, then
new_x = [x, 2*x(end)-fliplr(x(1:end-1))];
new_y = [y, fliplr(y(1:end-1))];
plot(new_x, new_y);
Drawing the bar is an exercise for you. Hint: look at ylim()

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by