Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
simple question on print

Subject: simple question on print

From: Vihang Patil

Date: 7 Feb, 2008 15:53:02

Message: 1 of 6

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: simple question on print

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

Date: 7 Feb, 2008 16:49:43

Message: 2 of 6

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: simple question on print

From: Vihang Patil

Date: 8 Feb, 2008 18:03:04

Message: 3 of 6

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: simple question on print

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

Date: 8 Feb, 2008 18:10:00

Message: 4 of 6

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: simple question on print

From: Vihang Patil

Date: 9 Feb, 2008 06:26:10

Message: 5 of 6

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

Subject: simple question on print

From: saroo

Date: 12 Feb, 2014 17:49:49

Message: 6 of 6

Hello I have follow the steps and arrived to the how to write text in notepad and ok, But the question is how can print notepad using MATLAB function
(print the notepad direct by matlab )

Tags for this Thread

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.

Contact us