- If else or Conditional Statements
- Plot
how do I plot the signal x(t)=t^2 for -2<=abs(t)<=2 and x(t)=0 for 2<=abs(t)<=4, with period To=8??
10 ビュー (過去 30 日間)
古いコメントを表示
how do I plot the signal x(t)=t^2 for -2<=abs(t)<=2 and x(t)=0 for 2<=abs(t)<=4, with period To=8?? also i would like to know how to calculate the complex coefficients of the fourier series and the approximation
0 件のコメント
回答 (1 件)
KALYAN ACHARJYA
2023 年 6 月 8 日
First Way:
To meet your professor's expectations, you can code by incorporating conditional statements or utilizing the if-else function.
Other way:
syms t
x_t=piecewise(-2<=abs(t) | abs(t)<=2,t.^2,2<=abs(t) | abs(t)<=4,0);
t_data=-8:0.01:8;
x_data=subs(x_t,t,t_data);
plot(t_data,x_data)
参考
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!