matlab-tree icon indicating copy to clipboard operation
matlab-tree copied to clipboard

Unrecognized method, property, or field 'tostring' for class 'tree'.

Open asma1994-bejaia opened this issue 3 years ago • 1 comments

t = tree('root'); [ t node1 ] = t.addnode(1, 'Node 1'); %% attach to root % node1 now contains the index of the first node. [ t node2 ] = t.addnode(1, 'Node 2'); %% attach to root [ t node11 ] = t.addnode(node1, 'Child of node 1'); %% attach to first node disp(t.tostring)

hi ! I get this message "Unrecognized method, property, or field 'tostring' for class 'tree'." when caling the tostring method and many authers methods like "graft", even if I added the location of the file that contains the tree class and the assosiated methods to the path of th system. I would be very gratiful if somone can help me

asma1994-bejaia avatar Feb 19 '22 00:02 asma1994-bejaia

Hello.

It looks like you did not set the path correctly. You must add the folder in which the @tree folder is, but not the content of the folder iteself.

Check this: https://se.mathworks.com/help/matlab/matlab_oop/organizing-classes-in-folders.html

tinevez avatar Feb 19 '22 09:02 tinevez