how to flip a function
4 次查看(过去 30 天)
显示 更早的评论
I am trying to flip the last plot so it can fit into the other plots
f = @(x) x.^3;
g = @(x)x;
a = 0;
b =1;
fplot(f, [a, b]), hold on
fplot(g, [a, b], 'LineWidth',2)
xline(2)
ycoord = linspace(a, b, 20);
xcoord = [f(ycoord); g(ycoord)];
plot(xcoord, [ycoord;ycoord]), hold off
^^ this plot
0 个评论
采纳的回答
Bruno Luong
2022-11-4
f = @(x) x.^3;
ivf = @(y) y.^(1/3);
g = @(x)x;
ivg = @(y) y;
a = 0;
b =1;
fplot(f, [a, b]), hold on
fplot(g, [a, b], 'LineWidth',2)
xline(2)
ycoord = linspace(a, b, 20);
xcoord = [ivf(ycoord); ivg(ycoord)];
plot(xcoord, [ycoord;ycoord]), hold off
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Calculus 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!