save a figure in a predefined folder as variable using print

4 次查看(过去 30 天)
Hi, there is a way to save a specific image (like figure 1 in the example below denoted as '-f1') in a specific folder a using the command “print” as follows:
print('-f1',filename,'-dpng')
where:
filename='EXAMPLE'
Figure1 is a random plot
What is missing here is the path where to save the png image which can be defined like this:
Saved_folder='D:\Main folder \Subfolder \Folder_test'
I would appreciate any help

采纳的回答

Star Strider
Star Strider 2023-11-24
Using the fullfile function may help. You have to supply the necessary information, however fullfile will build the path.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Convert Image Type 的更多信息

产品


版本

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by