imagename = [answer '.tif']
if you just want to append .tif.
Personally I would use uiputfile though rather than write my own inputdlg. Then you can specify .tif via the filterspec argument.
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!