Thread Subject: saveas error

Subject: saveas error

From: Priya

Date: 20 Nov, 2009 23:44:19

Message: 1 of 5

Usually I am able to save images in matlab. However something unusual happened today, which I have not been able to figure out.

Here is in a example:

>> plot(1:10)
>> saveas(gcf, 'test.tiff')
??? Error: File: printopt.m Line: 1 Column: 25
The input character is not valid in MATLAB statements or expressions.

Error in ==> printjob at 70
[ pj.PrintCmd, pj.DefaultDevice ] = printopt; %Defaults

Error in ==> print at 166
pj = printjob;

Error in ==> saveas at 159
        print( h, name, ['-d' dev{i}] )


Can someone please help me figure out what is wrong?

Thank you!

Subject: saveas error

From: Nathan

Date: 20 Nov, 2009 23:48:41

Message: 2 of 5

On Nov 20, 3:44 pm, "Priya " <ramst...@gmail.com> wrote:
> Usually I am able to save images in matlab.  However something unusual happened today, which I have not been able to figure out.  
>
> Here is in a example:
>
> >> plot(1:10)
> >> saveas(gcf, 'test.tiff')
>
> ??? Error: File: printopt.m Line: 1 Column: 25
> The input character is not valid in MATLAB statements or expressions.
>
> Error in ==> printjob at 70
> [ pj.PrintCmd, pj.DefaultDevice ] = printopt; %Defaults
>
> Error in ==> print at 166
> pj = printjob;
>
> Error in ==> saveas at 159
>         print( h, name, ['-d' dev{i}] )
>
> Can someone please help me figure out what is wrong?  
>
> Thank you!

Dunno. It worked for me (Matlab r2007b, r2009a, and r2009b)

Strange.

-Nathan

Subject: saveas error

From: Priya

Date: 20 Nov, 2009 23:55:04

Message: 3 of 5

Nathan <ngreco32@gmail.com> wrote in message <88ec2343-f4ed-48e8-9e48-a5b40f840f29@g1g2000pra.googlegroups.com>...
> On Nov 20, 3:44?pm, "Priya " <ramst...@gmail.com> wrote:
> > Usually I am able to save images in matlab. ?However something unusual happened today, which I have not been able to figure out. ?
> >
> > Here is in a example:
> >
> > >> plot(1:10)
> > >> saveas(gcf, 'test.tiff')
> >
> > ??? Error: File: printopt.m Line: 1 Column: 25
> > The input character is not valid in MATLAB statements or expressions.
> >
> > Error in ==> printjob at 70
> > [ pj.PrintCmd, pj.DefaultDevice ] = printopt; %Defaults
> >
> > Error in ==> print at 166
> > pj = printjob;
> >
> > Error in ==> saveas at 159
> > ? ? ? ? print( h, name, ['-d' dev{i}] )
> >
> > Can someone please help me figure out what is wrong? ?
> >
> > Thank you!
>
> Dunno. It worked for me (Matlab r2007b, r2009a, and r2009b)
>
> Strange.
>
> -Nathan


I know, it used to work for me too earlier, but it is not anymore.

Subject: saveas error

From: Steven Lord

Date: 26 Nov, 2009 22:36:58

Message: 4 of 5


"Priya " <ramstuff@gmail.com> wrote in message
news:he79kj$pji$1@fred.mathworks.com...
> Usually I am able to save images in matlab. However something unusual
> happened today, which I have not been able to figure out.
>
> Here is in a example:
>
>>> plot(1:10)
>>> saveas(gcf, 'test.tiff')
> ??? Error: File: printopt.m Line: 1 Column: 25
> The input character is not valid in MATLAB statements or expressions.
>
> Error in ==> printjob at 70
> [ pj.PrintCmd, pj.DefaultDevice ] = printopt; %Defaults
>
> Error in ==> print at 166
> pj = printjob;
>
> Error in ==> saveas at 159
> print( h, name, ['-d' dev{i}] )
>
>
> Can someone please help me figure out what is wrong?

What does "which -all printopt" show?

Edit it and look at line 1, column 25. What character is in that position?

--
Steve Lord
slord@mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ

Subject: saveas error

From: Joshua Thompson

Date: 29 Jan, 2010 17:26:05

Message: 5 of 5

"Steven Lord" <slord@mathworks.com> wrote in message <hemvrt$g04$1@fred.mathworks.com>...
>
> "Priya " <ramstuff@gmail.com> wrote in message
> news:he79kj$pji$1@fred.mathworks.com...
> > Usually I am able to save images in matlab. However something unusual
> > happened today, which I have not been able to figure out.
> >
> > Here is in a example:
> >
> >>> plot(1:10)
> >>> saveas(gcf, 'test.tiff')
> > ??? Error: File: printopt.m Line: 1 Column: 25
> > The input character is not valid in MATLAB statements or expressions.
> >
> > Error in ==> printjob at 70
> > [ pj.PrintCmd, pj.DefaultDevice ] = printopt; %Defaults
> >
> > Error in ==> print at 166
> > pj = printjob;
> >
> > Error in ==> saveas at 159
> > print( h, name, ['-d' dev{i}] )
> >
> >
> > Can someone please help me figure out what is wrong?
>
> What does "which -all printopt" show?
>
> Edit it and look at line 1, column 25. What character is in that position?
>
> --
> Steve Lord
> slord@mathworks.com
> comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ
>

I had a similar problem and found a fix. In my case it was a conflict between too many printopt.m files lying in the path.

Steve Lord suggested examining "line 1, column 25" of, I assume, printopt.m. I tried this using "edit printopt.m" and saw garbage because MATLAB opened some other copy that had been installed in directory created by the MATLAB compiler. (The directory included something like "_mcr" or "_mcc") I removed these directories and the problem was solved.

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
saveas not working Priya 20 Nov, 2009 18:49:06
rssFeed for this Thread
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com