Matlab ??How to make to same size matrixes plus together

Discussion in 'Programmer's Corner' started by Jane0329, Sep 16, 2011.

  1. Jane0329

    Thread Starter New Member

    Sep 12, 2011
    3
    0
    G matrix and C matrix,
    I wanna get A matrix equals to G matrix plus C matrix times s,
    which s is j*w.

    Just program A=G+s*C, matlab shows 'Inner matrix dimensions must agree.'
     
  2. steveb

    Senior Member

    Jul 3, 2008
    2,433
    469
    That should work, but your G and C matrix must be of the same size/dimensions, and your s variable should be a complex number, not a matrix.

    If it's still not working, list your code here.
     
  3. Jane0329

    Thread Starter New Member

    Sep 12, 2011
    3
    0
    Thanks, I found my 's' is a matrix not a conplex number...:D
     
Loading...