채택된 답변

Image Analyst
Image Analyst 2022년 10월 5일
편집: Image Analyst 2022년 10월 5일

0 개 추천

Here is one way:
x = linspace(-pi, pi, 1000);
f = zeros(1, length(x));
f(abs(x) <= pi/2) = 1;
plot(x, f, 'b-', 'LineWidth', 2)
ylabel('f');
xlabel('x');
grid on;

추가 답변 (1개)

Torsten
Torsten 2022년 10월 5일

0 개 추천

f = @(x) abs(x)<=pi/2;
x = linspace(-pi,pi,200);
plot(x,f(x))

카테고리

도움말 센터File Exchange에서 Simulation, Tuning, and Visualization에 대해 자세히 알아보기

태그

질문:

2022년 10월 5일

댓글:

2022년 10월 6일

Community Treasure Hunt

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

Start Hunting!

Translated by