how to use "fullfile" with exportgrahics

4 visualizaciones (últimos 30 días)
alpedhuez
alpedhuez el 26 de Nov. de 2020
Comentada: alpedhuez el 26 de Nov. de 2020
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?

Respuesta aceptada

Ameer Hamza
Ameer Hamza el 26 de Nov. de 2020
Editada: Ameer Hamza el 26 de Nov. de 2020
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 comentarios
alpedhuez
alpedhuez el 26 de Nov. de 2020
Thank you. It now has axis and legend but not the plot of a function itself. Please advise.
alpedhuez
alpedhuez el 26 de Nov. de 2020
A simpler workaround is to copy and paste graphics on Livescipt.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Printing and Saving en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by