필터 지우기
필터 지우기

Does somebody know how to plot this function?

조회 수: 1 (최근 30일)
Sabrina Bitz
Sabrina Bitz 2022년 5월 11일
댓글: Voss 2022년 5월 12일
I have the exercise to plot this function:
I have to use an anonymous function
That's my code until now:
figure; hold on;
y = @(x) tan(3*x) + 5*x-4;
x = linspace(0,180);
plot(x, y(x) ,'c');
axis([0 180 -100 1000]);
title('Funktion y = tan(3x)+5x-4');
xlabel('x-Werte[°]');
ylabel('Funktionswerte');
But I don't know how to get the parts between the tangent
or if my solution is even the right beginning, can somebody help?

채택된 답변

Voss
Voss 2022년 5월 11일
Use tand rather than tan, because the argument 3*x is in degrees rather than radians.
Increase the number of points to see the asymptotes better. Here I've used 1000 points total.
figure; hold on;
y = @(x) tand(3*x) + 5*x-4;
x = linspace(0,180,1000);
plot(x, y(x) ,'c');
axis([0 180 -100 1000]);
  댓글 수: 7
Sabrina Bitz
Sabrina Bitz 2022년 5월 12일
Thank you!!
Voss
Voss 2022년 5월 12일
You're welcome!

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

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by