Skip to Main Content Skip to Search
Login
File Exchange
MATLAB Newsgroup
Link Exchange
  Blogs  
 Contest 
MathWorks.com

Thread Subject: simple question on print

Subject: simple question on print

From: Vihang Patil

Date: 07 Feb, 2008 15:53:02

Message: 1 of 5

Hello
Probably a very dumb question,but how do I send the data
from a string variable to a printer?

ex:
str = 'My nams is Vihang';
print(str);

But I get this error,
??? Error using ==> graphics\private\validate
Error using ==> graphics\private\validate
No Figure to print.

I dont have any figure window, just want to print the value
from the string to the printer.
And one more thing, I dont want any dialog box to open after
I issue the print command. It should automatically send the
data from the string to the default printer.

Regards
Vihang

Subject: Re: simple question on print

From: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)

Date: 07 Feb, 2008 16:49:43

Message: 2 of 5

In article <fof9gu$ifj$1@fred.mathworks.com>,
Vihang Patil <vihang_patil@yahoo.com> wrote:

>Probably a very dumb question,but how do I send the data
>from a string variable to a printer?

Matlab does not provide any portable way of doing that.


>But I get this error,
>??? Error using ==> graphics\private\validate

The \ suggest you are using MS Windows. If so,
http://groups.google.ca/group/comp.soft-sys.matlab/msg/4f75ac214fd7ceea
That's Peter Boettcher, Nov 13 2007, "Formatting rows"
--
This is a Usenet signature block. Please do not quote it when replying
to one of my postings.
http://en.wikipedia.org/wiki/Signature_block

Subject: Re: simple question on print

From: Vihang Patil

Date: 08 Feb, 2008 18:03:04

Message: 3 of 5

roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson) wrote in
message <fofcr7$ef8$1@canopus.cc.umanitoba.ca>...
> In article <fof9gu$ifj$1@fred.mathworks.com>,
> Vihang Patil <vihang_patil@yahoo.com> wrote:
>
> >Probably a very dumb question,but how do I send the
data
> >from a string variable to a printer?
>
> Matlab does not provide any portable way of doing that.
>
>
> >But I get this error,
> >??? Error using ==> graphics\private\validate
>
> The \ suggest you are using MS Windows. If so,
> http://groups.google.ca/group/comp.soft-
sys.matlab/msg/4f75ac214fd7ceea
> That's Peter Boettcher, Nov 13 2007, "Formatting rows"
> --
> This is a Usenet signature block. Please do not quote it
when replying
> to one of my postings.
> http://en.wikipedia.org/wiki/Signature_block

Dear Walter
That was a really nice solution. The only one problem with
system(sprintf('notepad /p %s', filename)) , this command
was that it prints Page 1, page 2 and so on at the end of
the file which I dont want. Any way to suppress it?
Regards
Vihang

Subject: Re: simple question on print

From: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)

Date: 08 Feb, 2008 18:10:00

Message: 4 of 5

In article <foi5go$4jc$1@fred.mathworks.com>,
Vihang Patil <vihang_patil@yahoo.com> wrote:
>The only one problem with
>system(sprintf('notepad /p %s', filename)) , this command
>was that it prints Page 1, page 2 and so on at the end of
>the file which I dont want. Any way to suppress it?

http://www.worldstart.com/tips/tips.php/1421

might be useful in this matter.
--
This is a Usenet signature block. Please do not quote it when replying
to one of my postings.
http://en.wikipedia.org/wiki/Signature_block

Subject: Re: simple question on print

From: Vihang Patil

Date: 09 Feb, 2008 06:26:10

Message: 5 of 5

Thank You
That was helpful.
And, I think it is high time that the people at the
Mathworks implement this trivial code, into the Matlab itself.
Vihang

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
printer Vihang Patil 07 Feb, 2008 10:55:20
print Vihang Patil 07 Feb, 2008 10:55:20
rssFeed for this Thread

envelope graphic E-mail this page to a colleague

Public Submission Policy
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 Disclaimer prior to use.
Related Topics