Plotting discrete piecewise function
28 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Need to plot a discrete piecewise function.But the problem is between 6 and 9 the value should be (2n+1).Can somebody please help me out
x = @(n) 3*((0<=n) & (n<=5)) + 2*n.*((6<=n) & (n<=9)) + 0*((n<0) & (n>9));
n = -12:12;
figure
stem(n, x(n))
grid
0 commentaires
Réponses (1)
Walter Roberson
le 1 Fév 2021
x = @(n) 3*((0<=n) & (n<=5)) + (2*n+1).*((6<=n) & (n<=9)) + 0*((n<0) | (n>9));
n = -12:12;
figure
stem(n, x(n))
grid
0 commentaires
Voir également
Catégories
En savoir plus sur 2-D and 3-D Plots dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!