IBTresort (MatLab R2007b)

generates a new matrix using the upper part of the input matrix. Required by XFGIBT01.m.

Download File

Click the button to demonstrate a graph view. 
Notice: This content requires Java Runtime Environment.
Java Applet and JavaScript should be allowed on your browser.

Fri, July 27 2012 by Dedy Dwi Prastyo

T = IBTresort(matr)

- upper triangular matrix, the number of the rows is equal to the number of the columns

- Matrix: (2*rows(matr)-1)*rows(matr) matrix, the non-zero elements in T corresponding to the different elements in matr, others are 0


Description: matr=#(1,0,0)~#(2,3,0)~#(4,5,6) T=IBTresort(matr) matr T


function[Tree] = IBTresort(matr)
[m,n] = size(matr);
if (m ~= n || m<2)
    disp('IBTresort: data matrix must be square and must have at least 2 columns.');
    disp('Please input again');
    matr = input('matr=');
end
  Tree=zeros(2*m-1,m);
  i=1;
  while(i<m+1)
    j=1;
    while(j<i+1)
      Tree(m+1+i-j*2,i)=matr(j,i);
      j=j+1;
    end
    i=i+1;
  end