MATLAB: How to use logical vector E in the output of shortestpathtree command

MATLABshortestpathtree

I am trying to use the command, [TR,D,E]= shortestpathtree(G,1,'all','Method','positive','OutputForm','tree'), where G specifies a directed weighted graph without self-loop. I am getting the following message "Error using digraph/shortestpathtree Too many output arguments." If I remove E ( which is a logical vector indicating whether each edge is in TR.) from the output, it works fine. Could you please suggest the correct way to use E in the output?

Best Answer

The third output for shortestpathtree was added in release R2018a to support the multigraph functionality. If you're using release R2015b (as the Release information on this question suggests you are) shortestpathtree only returns a maximum of two output arguments.