In MATLAB, how do I plot to an image and save the result without displaying it?

前端 未结 5 1429
南笙
南笙 2020-12-02 08:19

This question kind of starts where this question ends up. MATLAB has a powerful and flexible image display system which lets you use the imshow and plot commands to display

5条回答
  •  误落风尘
    2020-12-02 09:05

    Here is a completely different answer:

    If you want an image file out, why not just save the image instead of the entire figure?

    im = magic(10)
    imwrite(im/max(im(:)),'magic.jpg')
    

    Then prove that it worked.

    imshow('magic.jpg')
    

    This can be done for indexed and RGB also for different output formats.

提交回复
热议问题