0
votes

I am using MATLAB R2013b. I don't understand why the following code is giving error-

    a=[1 1 1 2 2 3 3 4 4 5 7];
    b=[2 3 4 3 7 4 6 5 7 6 8];
    names={'A','B','C','D','E','F','G','H'};
    G=graph(a,b,[],names)

Error:Undefined function 'graph' for input arguments of type 'cell'.

1
There doesn't exist a function graph that accepts the inputs, definetly not cell, as you give it to it. That is what the error says. Either matlab forgot to add some input checking, or you may not have (or have shadowed) the function graphAnder Biguri

1 Answers

1
votes

The documentation for graph:

https://www.mathworks.com/help/matlab/ref/graph.html

States that graph was introduced in R2015b. The problem is that your version of MATLAB does not contain the graph function.