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에서 File Operations에 대해 자세히 알아보기

질문:

2015년 8월 24일

답변:

2015년 8월 24일

Community Treasure Hunt

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

Start Hunting!

Translated by