Help: Matlab2010a figure output

2 visualizaciones (últimos 30 días)
Wencai Lee
Wencai Lee el 6 de Abr. de 2011
Hi,
When I try to save the Matlab figure to an tiff file, there had some problem.
1) I used the command: >>print -dwin April05.tiff
The figure was saved but when opened it showed as a txt file and read:
%!PS-Adobe-2.0
%%Creator: MATLAB, The Mathworks, Inc. Version 7.10.0.499 (R2010a). Operating System: Microsoft Windows 7.
%%Title: .\April05.tif
%%CreationDate: 04/05/2011 18:09:51
%%DocumentNeededFonts: Helvetica
%%DocumentProcessColors: Cyan Magenta Yellow Black
%%Pages: (atend)
%%BoundingBox: (atend)
%%EndComments
Can any body help me with thiis issue?
2) Is there a way for me to save the figure to another path instead of the current work directory?

Respuesta aceptada

Andrew Newell
Andrew Newell el 7 de Abr. de 2011
Let's summarize what we know so far:
  1. The print command is creating a matrix with the correct dimensions and type, but you can't read it.
  2. We don't know yet whether you can view the image outside of MATLAB.
  3. You have the Image Processing Toolbox, so you should have imshow, but if you try using it you get an error saying there is no such function.
  4. which imshow -all returns "C:\Program Files\MATLAB\R2010a\toolbox\images\imuitools\imshow.m % Has no license available".
  5. You have tried rehash toolbox but it makes no difference.
I would still like to know the answer to (2), and you could try running imshow in C:\Program Files\MATLAB\R2010a\toolbox\images\imuitools\, but I think you probably have an installation problem and you should contact MATLAB Support.

Más respuestas (3)

Andrew Newell
Andrew Newell el 6 de Abr. de 2011
Try
print -dtiff April05.tiff
or
print -dtiffn April05.tiff
(see the list of printer drivers in print, printopt.)
To view it, use these commands:
A = imread('April05.tiff');
imshow(A)
To save in some other folder, just replace April05.tiff by the full pathname or a relative pathname, e.g.,
print -dtiff ../April05.tiff
EDIT: you could also try
image(A)
  21 comentarios
Wencai Lee
Wencai Lee el 7 de Abr. de 2011
??? Undefined function or method 'imshow' for input arguments of type 'uint8'.
Sean de Wolski
Sean de Wolski el 14 de Mzo. de 2012
Copying Wencai's comment with license number censored
Oh, sorry didn't quite understand the comment.Here I got:
-------------------------------------------------------------------------------------
MATLAB Version 7.10.0.499 (R2010a)
MATLAB License Number: ######
Operating System: Microsoft Windows 7 Version 6.1 (Build 7600)
Java VM Version: Java 1.6.0_12-b04 with Sun Microsystems Inc. Java HotSpot(TM) 64-Bit Server VM mixed mode
-------------------------------------------------------------------------------------
MATLAB Version 7.10 (R2010a)
Control System Toolbox Version 8.5 (R2010a)
Curve Fitting Toolbox Version 2.2 (R2010a)
Image Processing Toolbox Version 7.0 (R2010a)
Signal Processing Toolbox Version 6.13 (R2010a)
Statistics Toolbox Version 7.3 (R2010a)
Wavelet Toolbox Version 4.5 (R2010a)

Iniciar sesión para comentar.


Lior Shapira
Lior Shapira el 6 de Abr. de 2011
Might not be what you're looking for, but the SC utility on the file exchange (http://www.mathworks.com/matlabcentral/fileexchange/16233-sc-powerful-image-rendering) converts figures to images, which you can then save with imwrite in whatever format you desire.
  1 comentario
Wencai Lee
Wencai Lee el 6 de Abr. de 2011
Thanks for your answer. I tried imwrite command, it also gives me the matrix when I open the saved figure file..

Iniciar sesión para comentar.


bym
bym el 6 de Abr. de 2011
Another one of Oliver's contributions could also help
http://www.mathworks.com/matlabcentral/fileexchange/23629-exportfig
  1 comentario
Wencai Lee
Wencai Lee el 6 de Abr. de 2011
Hi Proecsm, Thanks for this answer. However,now it seems to be the problem of file view.

Iniciar sesión para comentar.

Categorías

Más información sobre Convert Image Type en Help Center y File Exchange.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by