Drawing an inverse of function

3 Ansichten (letzte 30 Tage)
Mohamed ahmed
Mohamed ahmed am 29 Nov. 2016
Beantwortet: Walter Roberson am 30 Nov. 2016
how can i draw the reflection of any function such as shown in picture ?
  1 Kommentar
John D'Errico
John D'Errico am 29 Nov. 2016
Sigh. That is NOT the inverse of a function.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Walter Roberson
Walter Roberson am 30 Nov. 2016
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()

Community Treasure Hunt

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

Start Hunting!

Translated by