

Hello,
It could be easily done using following function (writtenn as a script with an example).
// ska109 - Jan (jenik) Skapa
// Department of Telecommunications
// Faculty of Electrical Engineering and Computer Science
// VSB - Technical University of Ostrava
// 17. listopadu 15/2172
// 708 33 Ostrava - Poruba
// Czech Republic
// Date: 21.12.2018
//
// Contact: ska109@vsb.cz
clear(); // Remove all variables
xdel(winsid()); // Close all graphic windows
clc; // Clear the Scilab Console
function y = heaviside(x)
[r, c] = size(x);
y = zeros(r, c);
y(x == 0) = 1/2;
y(x > 0) = 1;
endfunction
// Example
x = -10:10;
y = heaviside(x - 2); // Time-shift applied
plot2d3(x, y, color('red'));
xlabel('x'); title('y = heaviside(x - 2)');


The math problems are very difficult for me, hope to find good fake ways here. Entertainment with slope game you will find extremely interesting.
27-12-18, 3:37 p.m. ska109
29-12-18, 11:15 a.m. Akhtar
Login to add comment