An octave/MATLAB u(t) function example: Difference between revisions

From Class Wiki
Jump to navigation Jump to search
(Created page with 'To make a unit step function in Octave, put the following in a file called u.m. This also works in MATLAB. function junk = u(time) junk=.5*(sign(time)+1); endfunction')
(No difference)

Revision as of 14:33, 12 October 2010

To make a unit step function in Octave, put the following in a file called u.m. This also works in MATLAB.

function junk = u(time)
junk=.5*(sign(time)+1);
endfunction