How to export the result as a picture

1 view (last 30 days)
How to export the result as a picture.
I use the
biograph
function that comes with matlab to get the roadmap, but I can't copy it. I can't export it to a picture. how do I copy it to the clipboard or export it to a picture file?
codes are as this
clc;
clear all;
close all;
close all hidden
W = [.41 .99 .51 .32 .15 .45 .38 .32 .36 .29 .21];
DG = sparse([6 1 2 2 3 4 4 5 5 6 1],[2 6 3 5 4 1 6 3 4 3 5],W)
h = view(biograph(DG,[],'ShowWeights','on'))
export(h,'h.png')

Accepted Answer

KSSV
KSSV on 3 Apr 2019
Edited: KSSV on 3 Apr 2019
close all;
close all hidden
W = [.41 .99 .51 .32 .15 .45 .38 .32 .36 .29 .21];
DG = sparse([6 1 2 2 3 4 4 5 5 6 1],[2 6 3 5 4 1 6 3 4 3 5],W)
h = biograph(DG,[],'ShowWeights','on')
% export(h,'h.png')
g = biograph.bggui(h);
f = figure;
copyobj(g.biograph.hgAxes,f);
f = get(g.biograph.hgAxes, 'Parent');
print(f, '-djpeg', 'test.jpg')

More Answers (0)

Categories

Find more on Environment and Settings in Help Center and File Exchange

Products


Release

R2014a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!