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...

 Respuesta aceptada

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.

Más respuestas (0)

Categorías

Más información sobre File Operations en Centro de ayuda y File Exchange.

Preguntada:

el 24 de Ag. de 2015

Respondida:

el 24 de Ag. de 2015

Community Treasure Hunt

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

Start Hunting!

Translated by