Plotting a piecewise returns error
조회 수: 1 (최근 30일)
이전 댓글 표시
Hello,
Plotting the code below returns the following erro:
syms t
t =[0:0.1:2*pi];
x = 2*sin(t);
%% Plot 1
figure (1)
f_1 = piecewise(t < -1, 1.5*2*sin(t)+1.5, -1 < t < 1, 0,t>1, 1.5*2*sin(t)-1.5);
plot(f_1, t);
Undefined function 'piecewise' for input arguments of type 'double'.
Please help, thank you
댓글 수: 0
답변 (1개)
Walter Roberson
2020년 9월 26일
t =[0:0.1:2*pi];
delete that line
plot(f_1, t);
instead
fplot(f_1, [0, 2*pi])
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Assumptions에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!