Need to delay an input

Discussion in 'Programmer's Corner' started by kwilson25j, Feb 25, 2012.

  1. kwilson25j

    Thread Starter New Member

    Feb 25, 2012
    This code is for simulating the time response of a circuit with two input voltages, v1 and v2. Solving the differential equations can be set up as matrices in matlab.

    This is my code thus far. I would like to delay my "v2" input by 2 seconds. How would I possibly go about this?

    Also, I am having problems simulating this time response without any delay, and I have noticed that my matrix dimensions must agree. I know that there will be a 4x4 and a 4x2 in my output, x, but my teacher assured us that this would work easily.

    Thanks for any help.
    Last edited: Feb 25, 2012