Output Filename With Print Command

조회 수: 13 (최근 30일)
Steve
Steve 2013년 4월 1일
The following command prints a postscript file of the current Simulink diagram:
print('-dps', '-s', gcs)
MATLab suggests the following to specify an output file name:
SPECIFYING THE OUTPUT FILE:
<filename> % String on the command line
'<filename>' % String passed in when using function form of PRINT
However, if I use it in the following way:
filename = 'Lies.ps'
print ('-dps', '-s', gcs, filename)
It fails because it thinks you want to print the current screen and some file named 'Lies.ps'.
What is the correct command to accomplish this monumental task?

채택된 답변

Walter Roberson
Walter Roberson 2013년 4월 1일
There is no '-s' option by itself, just '-s' followed as part of the same option by the modelname.
print('-dps', ['-s', gcs], filename)
  댓글 수: 1
Steve
Steve 2013년 4월 1일
You sir, are a miracle man!

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Prepare Model Inputs and Outputs에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by