How do I write code to plot ramp function? Is there any command for ramp?
Mostrar comentarios más antiguos
The discrete function I want to plot is g[n] = ramp[n + 2]− 2ramp[n]+ ramp[n − 2]
The interval is -5<=n<=10
Thanks in advance.
Respuesta aceptada
Más respuestas (1)
ismael rashid
el 19 de Oct. de 2019
1 voto
clc
clear all
signal_start = input(' signal start value : ');
signal_end = input(' signal end value : ');
ramp_value = input(' ramp : ');
a = [ signal_start:signal_end];
b =mod(a,ramp_value);
plot(a,b)
% hope it helps you
Categorías
Más información sobre Logical en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!