diff --git a/matlab/+gtsam/plotBayesNet.m b/matlab/+gtsam/plotBayesNet.m new file mode 100644 index 000000000..dea9b04ad --- /dev/null +++ b/matlab/+gtsam/plotBayesNet.m @@ -0,0 +1,8 @@ +function plotBayesNet(bayesNet) +% plotBayesNet saves as dot file, renders, and shows as image +% Needs dot installed + +bayesNet.saveGraph('/tmp/bayesNet.dot') +!dot -Tpng -o /tmp/dotImage.png /tmp/bayesNet.dot +dotImage=imread('/tmp/dotImage.png'); +imshow(dotImage) \ No newline at end of file