how to use "fullfile" with exportgrahics

조회 수: 4 (최근 30일)
alpedhuez
alpedhuez 2020년 11월 26일
댓글: alpedhuez 2020년 11월 26일
One can use fullfile for saveas
saveas(gcf, fullfile(directory, fileName),'jpeg')
But when I try to use
exportgraphics(gcf, fullfile(directory, fileName)', 'eps', 'Resolution',3000)
Then I get an error message
Input must be a row vector of characters or string scalar
What is the next step?

채택된 답변

Ameer Hamza
Ameer Hamza 2020년 11월 26일
편집: Ameer Hamza 2020년 11월 26일
exportgraphics(gcf, fullfile(directory, fileName)', 'eps', 'Resolution',3000)
%^ remove it
Why did you put transpose operator? Also, the output of exportgraphics() depends on extension of filename. It didn't accept file type seperately. So the correct syntax is
fileName = 'filename.eps'
exportgraphics(gcf, fullfile(directory, fileName), 'Resolution', 3000)
Note that it is better to export the eps file as vector.
fileName = 'filename.eps'
exportgraphics(gcf, fullfile(directory, fileName), 'ContentType', 'vector')
  댓글 수: 2
alpedhuez
alpedhuez 2020년 11월 26일
Thank you. It now has axis and legend but not the plot of a function itself. Please advise.
alpedhuez
alpedhuez 2020년 11월 26일
A simpler workaround is to copy and paste graphics on Livescipt.

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

추가 답변 (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