HOW CAN I MODIFY THE PATH WHERE MATLAB SAVE A FILE USING THE FUNCTION 'PRINT'?

h = figure; plot(1:4,5:8); path=uigetdir('C:\'); print(h,'-dpdf',report,'-r600');
%I want to save this file 'report.pdf' in the directory define by 'path'.. I don't know how to do it...

 采纳的回答

It is a really bad idea to name variables with the same name as a useful function. Here it is the name path.
As for saving the file to a specific directory. READ THE HELP FOR PRINT. You can specify the filename.
print -device -options filename
If you specify a filename, MATLAB directs output to a file instead of
a printer. print adds the appropriate file extension if you do not
specify one.
If that filename has a path attached to it, where do you think the file will appear? Of course.

更多回答(0 个)

类别

在 帮助中心 和 File Exchange 中查找有关 Environment and Settings 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by