How do you print an image from a printer in Matlab GUI? I get an error using the code below. Please help me.
smapleimage = imread('image.png');
printdlg(handles.smapleimage)
...
Undefined function or variable 'smapleimage'.
That's because smapleimage is numeric, while printdlg only accepts figure handles.
1) One may either create a matlab figure first (it might be hidden though)
smapleimage = imread('image.png');
image(smapleimage)
printdlg
2) ..or call some system tool, to print from command line, like this:
system('mspaint /pt image.png');
Other command-line printing options are discussed here: 1,2,3 .