How to arrange and print the contents of row cells by coincidence in separate rows, Matlab?

I want to print the contents of a cell row so that the corresponding rows are one after another. The source line looks like this:

Example 1:

'E11E81'    'E21E81'    'E31E51'    'E31E61'    'E61E81'

From this line, I would like to print:

E11 - E81 - E61 - E31 - E51
       |
      E21

Example 2:

'E11E81'    'E21E82'    'E31E81'    'E31E83'    'E51E83'    'E61E82'    'E61E83'    'E81E82'

From this line, I would like to print:

E11 -  E81 - E31 - E83 - E5   
        |           |
 E21 - E82 - E61  - 

So far for each cell position I have used

b = strncmp('E11E81',current_connection,6);
if  b == 1, disp('E1 - E81 - '); end

but I don’t know how to go further.

Any ideas? Thanks for your thoughts!

+4
source share
1 answer

An alternative to the aforementioned graphconncompis gplot, but gplothas the problem, that the nodes must be placed manually.

Let C be your connection matrix:

[x,y]=ind2sub([ceil(sqrt(size(C,1))),ceil(sqrt(size(C,1)))],1:numel(C))
gplot(C, [x' y'])

, .

0

All Articles