フィルターのクリア

Plotting a piecewise returns error

1 回表示 (過去 30 日間)
Braden Kerr
Braden Kerr 2020 年 9 月 26 日
回答済み: Walter Roberson 2020 年 9 月 26 日
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

回答 (1 件)

Walter Roberson
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])

カテゴリ

Help Center および File ExchangeAssumptions についてさらに検索

タグ

製品


リリース

R2016b

Community Treasure Hunt

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

Start Hunting!

Translated by