From: alex lunax on
I need to define my symbolic discrete function only for k>=2. In the paper i write something like
f(k)=2^k * u (k-2)

u(k) is a step discrete function that is 0 for k<0 and 1 for k>=0. So u(k-2) is 0 for k<2 and 1 for k>=2. (The purpose is to CUTOFF a part of function).

Ok I just need this on matlab. I tryed:

syms k;
f=2^k .*(k>2);

but received this error ??? Error using ==> sym.sym>notimplemented at 2514
Function 'gt' is not implemented for MuPAD symbolic objects.

Ok this is not a way so HOW can i write the discrete step function (1 for k>=0 , 0 otherwise) or HOW can i use the .* operator ? Or There is another way?

Thx for the answer.
From: alex lunax on
Or question in another way. How can i use heaviside function but with value of 1 for k=0 and not 1/2 ?
From: Wayne King on
"alex lunax" <ludaoc(a)hotmail.com> wrote in message <i02o4t$hti$1(a)fred.mathworks.com>...
> I need to define my symbolic discrete function only for k>=2. In the paper i write something like
> f(k)=2^k * u (k-2)
>
> u(k) is a step discrete function that is 0 for k<0 and 1 for k>=0. So u(k-2) is 0 for k<2 and 1 for k>=2. (The purpose is to CUTOFF a part of function).
>
> Ok I just need this on matlab. I tryed:
>
> syms k;
> f=2^k .*(k>2);
>
> but received this error ??? Error using ==> sym.sym>notimplemented at 2514
> Function 'gt' is not implemented for MuPAD symbolic objects.
>
> Ok this is not a way so HOW can i write the discrete step function (1 for k>=0 , 0 otherwise) or HOW can i use the .* operator ? Or There is another way?
>
> Thx for the answer.

Hi Alex, if you want it as symbolic function, you want to use heaviside

syms x
y =2^x*heaviside(x-2);
ezplot(y,[0 5])

Hope that helps,
Wayne
From: alex lunax on
> Hi Alex, if you want it as symbolic function, you want to use heaviside
>
> syms x
> y =2^x*heaviside(x-2);
> ezplot(y,[0 5])
>
> Hope that helps,
> Wayne

Yes thx, but heaviside(x) is 1/2 for x=0. This is not a problem for see it grapically but if you need to ztrans that function we have some trouble.. For example:

y =5^(k-2)*heaviside(k-2);

>> pretty(simplify(ztrans(y)))

5 1
----- + -
z - 5 2
---------
2
z

And this is wrong cause the real ztrans for
y=5^(k-2) * u(k-2)
is
(1/z^2)* (z/z-5)

Thx for answer.