Interchanging Upper triangle matrix to Lower triangle matix

Discussion in 'MATLAB' started by abcdefg, Jun 13, 2006.

  1. abcdefg

    abcdefg Guest

    Hi

    i am new to matlab. i need help in solving this problem.

    ihave a upper triangle matrix which is

    1 1 1 1 1
    0 0 1 1 1
    0 0 0 1 1
    0 0 0 0 1
    0 0 0 0 0

    I Need to change it to a lower triangle matrix

    0 0 0 0 0
    1 0 0 0 0
    1 1 0 0 0
    1 1 1 0 0
    1 1 1 1 1

    Please help
     
    abcdefg, Jun 13, 2006
    #1
    1. Advertisements

  2. abcdefg

    Jos Guest

    up = [1 1 1 ; 0 1 1 ; 0 0 1 ; 0 0 0] ;
    low = ~up ;

    hth
    Jos
     
    Jos, Jun 13, 2006
    #2
    1. Advertisements

  3. abcdefg

    verm25 Guest

    If your original matrix is mtx1 then the result could be had with
    rot90(mtx1,2);
    or
    flipud(fliplr(mtx1));
     
    verm25, Jun 13, 2006
    #3
  4. abcdefg

    Jérôme Guest

    Hi,

    for square matrix :

    M=[1 1 1 1 1
    0 0 1 1 1
    0 0 0 1 1
    0 0 0 0 1
    0 0 0 0 0]

    M:))=M(end:-1:1)

    Jérôme
     
    Jérôme, Jun 13, 2006
    #4
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.