man, 10 08 2009 kl. 20:56 +1000, skrev Lyle Collins:
> I have fixed the functions according to the previous suggestion (the
> coding of errors - see attached), but as to point that they may be a
> little too simplistic I would like to point out that they can be used
> for vectors more complicated than vectors with elements ascendingly
> numbered, or for creating a unit step function input vector. These
> could be useful maybe in converting an analog signal into a digital
> signal.
> Eg.:
> The vector t = [-2 -1 0 1 2 1 0 -1 -2 -1 0] as argument in function
> ustep(t,0) will be returned as [0 0 1 1 1 1 1 0 0 0 1]. Obviously this
> could be extended to such a point where the one line code suggestions
> would be impractical.
>
> The other two, uramp and upulse can be used for similar purposes.
I just had a look at your functions, and I don't think I actually
understand them. It seems to me that you could do
function output = upulse (t, t0)
output = (t != t0);
endfunction
function output = uramp (t, t0)
output = t;
output (t < t0) = 0;
endfunction
function output = ustep (t, t0)
output = (t < t0);
endfunction
Is that correct or am I missing something?
Søren
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Octave-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/octave-dev