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:
why does startup.m gets compiled along with the rest of the code?

Subject: why does startup.m gets compiled along with the rest of the code?

From: Vihang Patil

Date: 21 Mar, 2008 14:14:02

Message: 1 of 5

Hello
When I compile a code that is in separate directory, I see
that even my startup.m file also gets compiled along with
it..
Why is it so? and How do I avoid doing that?
I really dont see any significance of the startup.m file
being compiled along with the rest of my code..
P.N: OS is Windows XP Matlab ver R2006b.

Vihang

Subject: why does startup.m gets compiled along with the rest of the code?

From: Scott Burnside

Date: 21 Mar, 2008 19:25:04

Message: 2 of 5

"Vihang Patil" <vihang_patil@yahoo.com> wrote in message
<fs0fra$qie$1@fred.mathworks.com>...
> Hello
> When I compile a code that is in separate directory, I
see
> that even my startup.m file also gets compiled along
with
> it..
> Why is it so? and How do I avoid doing that?
> I really dont see any significance of the startup.m file
> being compiled along with the rest of my code..
> P.N: OS is Windows XP Matlab ver R2006b.
>
> Vihang

We usually suppress startup.m during compiling by simply
renaming it "suppress_startup.m" and also add the path to
the compile_targets directory.

Scott

Subject: why does startup.m gets compiled along with the rest of the code?

From: Vihang Patil

Date: 22 Mar, 2008 06:02:07

Message: 3 of 5

"Scott Burnside" <no@spam.com> wrote in message
<fs122g$hrs$1@fred.mathworks.com>...
> "Vihang Patil" <vihang_patil@yahoo.com> wrote in message
> <fs0fra$qie$1@fred.mathworks.com>...
> > Hello
> > When I compile a code that is in separate directory, I
> see
> > that even my startup.m file also gets compiled along
> with
> > it..
> > Why is it so? and How do I avoid doing that?
> > I really dont see any significance of the startup.m file
> > being compiled along with the rest of my code..
> > P.N: OS is Windows XP Matlab ver R2006b.
> >
> > Vihang
>
> We usually suppress startup.m during compiling by simply
> renaming it "suppress_startup.m" and also add the path to
> the compile_targets directory.
>
> Scott

But then this is not really a workaround. And this is a
serious bug which needs to be resolved by TMW.
Vihang

Subject: why does startup.m gets compiled along with the rest of the code?

From: Pekka

Date: 24 Mar, 2008 11:47:02

Message: 4 of 5

"Vihang Patil" <vihang_patil@yahoo.com> wrote in message
<fs27cv$ppo$1@fred.mathworks.com>...
> "Scott Burnside" <no@spam.com> wrote in message
> <fs122g$hrs$1@fred.mathworks.com>...
> > "Vihang Patil" <vihang_patil@yahoo.com> wrote in
message
> > <fs0fra$qie$1@fred.mathworks.com>...
> > > Hello
> > > When I compile a code that is in separate directory,
I
> > see
> > > that even my startup.m file also gets compiled along
> > with
> > > it..
> > > Why is it so? and How do I avoid doing that?
> > > I really dont see any significance of the startup.m
file
> > > being compiled along with the rest of my code..
> > > P.N: OS is Windows XP Matlab ver R2006b.
> > >
> > > Vihang
> >
> > We usually suppress startup.m during compiling by
simply
> > renaming it "suppress_startup.m" and also add the path
to
> > the compile_targets directory.
> >
> > Scott
>
> But then this is not really a workaround. And this is a
> serious bug which needs to be resolved by TMW.
> Vihang

I was wondering about the same thing some time ago. Can't
remember why and how, but I came to conclution that it is
on purpose.
My workaround (propably suggested somewhere...) was to skip
most of my startup if compiled by isdeployed, which is more
or less (I guess) meant for such cases..
My startup.m:
if (~isdeployed) % do nothing if compiled
    most of the code, all actually
end

Subject: why does startup.m gets compiled along with the rest of the code?

From: Vihang Patil

Date: 24 Mar, 2008 12:07:01

Message: 5 of 5

"Pekka " <pekka.nospam.kumpulainen@tut.please.fi> wrote in
message <fs84bm$ce8$1@fred.mathworks.com>...
> "Vihang Patil" <vihang_patil@yahoo.com> wrote in message
> <fs27cv$ppo$1@fred.mathworks.com>...
> > "Scott Burnside" <no@spam.com> wrote in message
> > <fs122g$hrs$1@fred.mathworks.com>...
> > > "Vihang Patil" <vihang_patil@yahoo.com> wrote in
> message
> > > <fs0fra$qie$1@fred.mathworks.com>...
> > > > Hello
> > > > When I compile a code that is in separate
directory,
> I
> > > see
> > > > that even my startup.m file also gets compiled
along
> > > with
> > > > it..
> > > > Why is it so? and How do I avoid doing that?
> > > > I really dont see any significance of the
startup.m
> file
> > > > being compiled along with the rest of my code..
> > > > P.N: OS is Windows XP Matlab ver R2006b.
> > > >
> > > > Vihang
> > >
> > > We usually suppress startup.m during compiling by
> simply
> > > renaming it "suppress_startup.m" and also add the
path
> to
> > > the compile_targets directory.
> > >
> > > Scott
> >
> > But then this is not really a workaround. And this is a
> > serious bug which needs to be resolved by TMW.
> > Vihang
>
> I was wondering about the same thing some time ago.
Can't
> remember why and how, but I came to conclution that it
is
> on purpose.
> My workaround (propably suggested somewhere...) was to
skip
> most of my startup if compiled by isdeployed, which is
more
> or less (I guess) meant for such cases..
> My startup.m:
> if (~isdeployed) % do nothing if compiled
> most of the code, all actually
> end
>

Thanks Pekka
I have used your recommendation "if (~isdeployed)" in my
startup.m file.
Regards
Vihang

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