필터 지우기
필터 지우기

How do I make a range for a graph that is from 0 to 2pi in increments of pi/4?

조회 수: 11 (최근 30일)
I think I am just forgetting something simple, but how do I make a range for a graph that is from 0 to 2pi in increments of pi/4? I added my code below.
Theta = linspace(0,(pi)/4,2*(pi));
%%% Part B
y5 = cos(Theta);
y6 = sin(Theta);
%%% Part C
figure()
plot(Theta,y5, Theta,y6)
xlabel('Theta')
ylabel ('y5(Theta) and y6(Theta)')
legend('y5','y6')

채택된 답변

Torsten
Torsten 2022년 3월 25일
편집: Torsten 2022년 3월 25일
Theta = 0:pi/4:2*pi
or
Theta = linspace(0,2*pi,2*pi/(pi/4)+1);

추가 답변 (0개)

카테고리

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

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by