save trainnetwork plot as image in matlab

To save a trainNetwork plot as an image in MATLAB, you can use the saveas function. Here is an example:

main.m
net = trainNetwork(X,Y,layers);
plot(net)
saveas(gcf, 'net_plot.png')
70 chars
4 lines

The plot function creates the trainNetwork plot, and gcf gets the handle of the current figure. saveas saves the current figure to a PNG file with the name net_plot.png.

You can replace the file type with other image types such as JPEG, BMP, or TIFF, by changing the file extension.

related categories

gistlibby LogSnag