niteshadw
Electrical
- Oct 6, 2006
- 1
Hi,
I'm new to matlab and I'm trying to figure out how to define and execute differential equations in matlab, for example, how would you define the following equation:
y
= x
+ 2 x(n ? 1) ? 0.95 y(n ? 1)
this is to implement an input signal that is N-samples long, so I guess its (0 [less than or equal to] n [less than or equal to] N [less than or equal to] ?1) but indexing in matlab starts at 1 not 0...this is what I have thus far, can anyone help me out? Thank you
function y = mydiffeq
x(-1) = 0;
y(-1) = 0;
y = mydiffeq
;
y1 = mydiffeq([0,n]);
I'm new to matlab and I'm trying to figure out how to define and execute differential equations in matlab, for example, how would you define the following equation:
y
this is to implement an input signal that is N-samples long, so I guess its (0 [less than or equal to] n [less than or equal to] N [less than or equal to] ?1) but indexing in matlab starts at 1 not 0...this is what I have thus far, can anyone help me out? Thank you
function y = mydiffeq
x(-1) = 0;
y(-1) = 0;
y = mydiffeq
y1 = mydiffeq([0,n]);