Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: saveas error
Date: Fri, 29 Jan 2010 17:26:05 +0000 (UTC)
Organization: Colorado State University
Lines: 39
Message-ID: <hjv5nd$cpo$1@fred.mathworks.com>
References: <he79kj$pji$1@fred.mathworks.com> <hemvrt$g04$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1264785965 13112 172.30.248.38 (29 Jan 2010 17:26:05 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 29 Jan 2010 17:26:05 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1683717
Xref: news.mathworks.com comp.soft-sys.matlab:602868


"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.