Simple question, how can I plot this tan x function?

조회 수: 19 (최근 30일)
Stephanie Ruiz
Stephanie Ruiz 2021년 5월 23일
답변: Star Strider 2021년 5월 23일
I want to be able to plot the following equation into matlab and be able to graph it, but I'm not sure how to do it.
- x = - tan (y)
How would I go about this?

채택된 답변

Star Strider
Star Strider 2021년 5월 23일
Perhaps —
x = @(y) tan(y)
x = function_handle with value:
@(y)tan(y)
figure
fplot(x, [-pi pi])
grid
xticks([-pi -pi/2 0 pi/2 pi])
set(gca, 'XTickLabel',{'$-\pi$', '$-\frac{\pi}{2}$' '$0$' '$\frac{\pi}{2}$' '$\pi$'}, 'TickLabelInterpreter','latex', 'FontSize',12)
.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Graph and Network Algorithms에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by