How do I write code to plot ramp function? Is there any command for ramp?
191 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Ae lay
am 26 Mär. 2015
Kommentiert: the cyclist
am 15 Aug. 2020
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.
0 Kommentare
Akzeptierte Antwort
the cyclist
am 26 Mär. 2015
There is no ramp function in MATLAB, but it could easily be coded as
function r = ramp(x)
r = max(0,x)
7 Kommentare
the cyclist
am 15 Aug. 2020
If that doesn't help, please use more than 8 words to fully describe what you are trying to do, so that people don't waste time guessing at what you want.
Weitere Antworten (1)
ismael rashid
am 19 Okt. 2019
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
0 Kommentare
Siehe auch
Kategorien
Mehr zu Antennas, Microphones, and Sonar Transducers finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!