My mesh fiber has my values as shown in fig 1:
Finish 1: Format the values, as currently displayed in Matlab for my code Now I would like to express these values as a lattice tree, as shown in Fig. 2 (note 2 figures are not equal in nature , And fig 2 are for demonstration purpose only). How can I modify my code in matlab so that the result looks as if the tree format shown in figure 2?: fig 2: the format of values, as I would like to display in my Matlab result My code is: If your goal is to reformat an upper triangular matrix (as the figure 1) is arranged in a structure similar to a tree (as shown in figure 2) with non-zero values with a matrix, so you can complete it using the function. Here is an example using 5-by-5 matrix:
& gt; & Gt; A = triu (reshape (1: 25,5,5))% # A sample upper triangular matrix A = 1 6 11 16 21 0 7 12 17 22 0 0 13 18 23 0 0 9 24 0 0 0 0 25 & Gt; & Gt; N = size (A, 1); % # A and gt; & Gt; The size of rows and columns in b = full (spdiags (spdiags (a), (1-n): 2: (n-1), zero (2 * n-1, n)) b = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 11 0 22 0 6 0 17 0 1 0 12 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 25 < / Div>
Comments
Post a Comment