Drawing an inverse of function

4 次查看(过去 30 天)
Mohamed ahmed
Mohamed ahmed 2016-11-29
how can i draw the reflection of any function such as shown in picture ?

回答(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