filename of function print

조회 수: 2 (최근 30일)
Dennis D.
Dennis D. 2017년 3월 8일
댓글: Rik 2017년 3월 9일
Hello Guys,
I am using the print function for creating eps files for my bachelor thesis.
print('filename' ,'-painters','-depsc', '-r300')
I have the following problem. The filenames of my diagrams are different depending on the experiment. I found out how to use the string function to create names for my diagrams by my inputs. And I am trying the same here.
For example:
name = string({'growthcurve'});
Now Matlab use name for the generation of the diagram title 'growthcurve'.
Is it possible to say the print function also that it should use the variable 'name' to name the file 'growthcurve'. Like print(name ,'-painters','-depsc', '-r300') and the filename then is growthcurve.eps?
Sorry for my english :)
Best wishes
Dennis
  댓글 수: 5
Dennis D.
Dennis D. 2017년 3월 9일
Thanks for this quick answer and the tipp :-) But I got error messages!
Error using checkArgsForHandleToPrint Handle input argument contains nonhandle values.
Error in checkArgsForHandleToPrint
Error in print>LocalCreatePrintJob (line 216) handles = checkArgsForHandleToPrint(0, varargin{:});
Error in print (line 38) [pj, inputargs] = LocalCreatePrintJob(varargin{:});
Error in test (line 10) print(nameCurve,'-painters','-depsc', '-r300')
Rik
Rik 2017년 3월 9일
Hmm. The error tree suggests that the print function interprets nameCurve as a handle, which it isn't. Do you really need the interpreter do be set to '-painters'? Otherwise you might give it a try without that switch.

댓글을 달려면 로그인하십시오.

채택된 답변

Thorsten
Thorsten 2017년 3월 9일
medium = 'XYZ';
replica = 'Replica1';
nameCurve = ['growthcurve', medium, ' ', replica];
nameSemlog = ['semilogy growthcurve', medium, ' ', replica];
print(nameCurve, '-painters', '-depsc', '-r300')
  댓글 수: 1
Dennis D.
Dennis D. 2017년 3월 9일
Now it is working. Thank you :-)

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Printing and Saving에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by