Creating ramp signal from -1 to 1
Show older comments
I am trying to create a linear line from y = -1 to 1 from x = 0 to 2000 but my code is creating the linear line from y = 0 to 1. Where am I going wrong with this?
y = 167
t = 60
x = linspace(0, t, y*t);
rampIdx = 2000;
s4 = zeros(1, length(x));
s4(rampIdx+1:end)=1;
s4(1:rampIdx+1) = -1;
s4(1:rampIdx+1) = (1:rampIdx)/rampIdx
Accepted Answer
More Answers (0)
Categories
Find more on Creating and Concatenating Matrices in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!