Thread Subject: [quick Q] how to run a scirpt in my .m file? Thanks!

Subject: [quick Q] how to run a scirpt in my .m file? Thanks!

From: Learner

Date: 19 Aug, 2008 05:01:29

Message: 1 of 12

,gzip(gfe),gzip(gfe)
Xref: news.mathworks.com comp.soft-sys.matlab:486156

Hi,

I have saved a code segment as a.m, and I want to run it as part of
code b.m. What should I write in b.m in order to call "a.m"?

Thanks a lot!

Subject: [quick Q] how to run a scirpt in my .m file? Thanks!

From: Walter Roberson

Date: 19 Aug, 2008 05:25:03

Message: 2 of 12

Learner wrote:

> I have saved a code segment as a.m, and I want to run it as part of
> code b.m. What should I write in b.m in order to call "a.m"?

You would write the line

a

That is, just give the name of the .m file, but without the .m
(and without any directory information.)

--
Q = quotation(rand);
if isempty(Q); error('Quotation server filesystem problems')
else sprintf('%s',Q), end

Subject: [quick Q] how to run a scirpt in my .m file? Thanks!

From: James Tursa

Date: 19 Aug, 2008 06:36:02

Message: 3 of 12

Learner <cnfengshuang@gmail.com> wrote in message
<f64841f0-c4ff-49b8-a25e-8c4b6c5796ae@m45g2000hsb.googlegroups.com>...
> ,gzip(gfe),gzip(gfe)
> Xref: news.mathworks.com comp.soft-sys.matlab:486156
>
> Hi,
>
> I have saved a code segment as a.m, and I want to run it
as part of
> code b.m. What should I write in b.m in order to call "a.m"?
>
> Thanks a lot!
>

a

James Tursa

Subject: [quick Q] how to run a scirpt in my .m file? Thanks!

From: Miroslav Balda

Date: 19 Aug, 2008 06:40:04

Message: 4 of 12

Learner <cnfengshuang@gmail.com> wrote in message
<f64841f0-c4ff-49b8-a25e-8c4b6c5796ae@m45g2000hsb.googlegroups.com>...
> ,gzip(gfe),gzip(gfe)
> Xref: news.mathworks.com comp.soft-sys.matlab:486156
>
> Hi,
>
> I have saved a code segment as a.m, and I want to run it
as part of
> code b.m. What should I write in b.m in order to call "a.m"?
>
> Thanks a lot!
>

Write simply a name of the scipt, in this case
a

Mira

Subject: [quick Q] how to run a scirpt in my .m file? Thanks!

From: Omur Bas

Date: 19 Aug, 2008 06:42:01

Message: 5 of 12

Learner <cnfengshuang@gmail.com> wrote in message
<f64841f0-c4ff-49b8-a25e-8c4b6c5796ae@m45g2000hsb.googlegroups.com>...
> ,gzip(gfe),gzip(gfe)
> Xref: news.mathworks.com comp.soft-sys.matlab:486156
>
> Hi,
>
> I have saved a code segment as a.m, and I want to run it
as part of
> code b.m. What should I write in b.m in order to call "a.m"?
>
> Thanks a lot!
>

Just the name of the script, possibly followed by a semicolon:

a;

HTH,
Omur
www.promodsoftware.com.tr

Subject: [quick Q] how to run a scirpt in my .m file? Thanks!

From: John D'Errico

Date: 19 Aug, 2008 08:41:02

Message: 6 of 12

Learner <cnfengshuang@gmail.com> wrote in message <f64841f0-c4ff-49b8-
a25e-8c4b6c5796ae@m45g2000hsb.googlegroups.com>...
> ,gzip(gfe),gzip(gfe)
> Xref: news.mathworks.com comp.soft-sys.matlab:486156
>
> Hi,
>
> I have saved a code segment as a.m, and I want to run it as part of
> code b.m. What should I write in b.m in order to call "a.m"?
>
> Thanks a lot!

a(stuff)

help addpath
help path

HTH,
John

Subject: [quick Q] how to run a scirpt in my .m file? Thanks!

From: Per Sundqvist

Date: 19 Aug, 2008 10:49:01

Message: 7 of 12

Learner <cnfengshuang@gmail.com> wrote in message
<f64841f0-c4ff-49b8-a25e-8c4b6c5796ae@m45g2000hsb.googlegroups.com>...
> ,gzip(gfe),gzip(gfe)
> Xref: news.mathworks.com comp.soft-sys.matlab:486156
>
> Hi,
>
> I have saved a code segment as a.m, and I want to run it
as part of
> code b.m. What should I write in b.m in order to call "a.m"?
>
> Thanks a lot!
>

run(a)

Subject: [quick Q] how to run a scirpt in my .m file? Thanks!

From: David

Date: 19 Aug, 2008 11:19:02

Message: 8 of 12

Learner <cnfengshuang@gmail.com> wrote in message
<f64841f0-c4ff-49b8-a25e-
8c4b6c5796ae@m45g2000hsb.googlegroups.com>...
> ,gzip(gfe),gzip(gfe)
> Xref: news.mathworks.com comp.soft-sys.matlab:486156
>
> Hi,
>
> I have saved a code segment as a.m, and I want to run it
as part of
> code b.m. What should I write in b.m in order to
call "a.m"?
>
> Thanks a lot!
>

a

Subject: [quick Q] how to run a scirpt in my .m file? Thanks!

From: Daphne

Date: 19 Aug, 2008 12:15:02

Message: 9 of 12


This should work:
[output,from,a]= a(input,to,a);


Daphne


Learner <cnfengshuang@gmail.com> wrote in message
<f64841f0-c4ff-49b8-a25e-
8c4b6c5796ae@m45g2000hsb.googlegroups.com>...
> ,gzip(gfe),gzip(gfe)
> Xref: news.mathworks.com comp.soft-sys.matlab:486156
>
> Hi,
>
> I have saved a code segment as a.m, and I want to run it
as part of
> code b.m. What should I write in b.m in order to
call "a.m"?
>
> Thanks a lot!
>

Subject: [quick Q] how to run a scirpt in my .m file? Thanks!

From: Adam

Date: 19 Aug, 2008 12:17:02

Message: 10 of 12

Learner <cnfengshuang@gmail.com> wrote in message
<f64841f0-c4ff-49b8-a25e-8c4b6c5796ae@m45g2000hsb.googlegroups.com>...
> ,gzip(gfe),gzip(gfe)
> Xref: news.mathworks.com comp.soft-sys.matlab:486156
>
> Hi,
>
> I have saved a code segment as a.m, and I want to run it
as part of
> code b.m. What should I write in b.m in order to call "a.m"?
>
> Thanks a lot!
>

a

~Adam

Subject: [quick Q] how to run a scirpt in my .m file? Thanks!

From: Walter Roberson

Date: 19 Aug, 2008 13:25:36

Message: 11 of 12

John D'Errico wrote:
> Learner <cnfengshuang@gmail.com> wrote in message <f64841f0-c4ff-49b8-
> a25e-8c4b6c5796ae@m45g2000hsb.googlegroups.com>...
>> ,gzip(gfe),gzip(gfe)
>> Xref: news.mathworks.com comp.soft-sys.matlab:486156

>> I have saved a code segment as a.m, and I want to run it as part of
>> code b.m.

> a(stuff)

Not quite: you cannot pass arguments to a script file.

--
Q = quotation(rand);
if isempty(Q); error('Quotation server filesystem problems')
else sprintf('%s',Q), end

Subject: [quick Q] how to run a scirpt in my .m file? Thanks!

From: Walter Roberson

Date: 19 Aug, 2008 13:27:25

Message: 12 of 12

Daphne wrote:
> This should work:
> [output,from,a]= a(input,to,a);

Ummm, that would -not- work. You cannot pass arguments
to a script file.


--
Q = quotation(rand);
if isempty(Q); error('Quotation server filesystem problems')
else sprintf('%s',Q), end

Tags for this Thread

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.

rssFeed for this Thread

Contact us at files@mathworks.com