Thread Subject: Getting the name of the calling funtion

Subject: Getting the name of the calling funtion

From: Adam

Date: 19 May, 2009 20:07:02

Message: 1 of 4

Hello,

Lets say that I am in a function fun1, and I call function fun2.

Can fun2 determine that it was called by fun1. Ideally I would like something like:

z = getcallingfunction(), which when called in fun2 would set z to the string fun1.

Thank you!

  Adam

Subject: Getting the name of the calling funtion

From: us

Date: 19 May, 2009 20:13:01

Message: 2 of 4

"Adam " <king@cs.fairfield.edu> wrote in message <guv3h6$r9t$1@fred.mathworks.com>...
> Hello,
>
> Lets say that I am in a function fun1, and I call function fun2.
>
> Can fun2 determine that it was called by fun1. Ideally I would like something like:
>
> z = getcallingfunction(), which when called in fun2 would set z to the string fun1.
>
> Thank you!
>
> Adam

a hint:

     help dbstack;

us

Subject: Getting the name of the calling funtion

From: Adam

Date: 19 May, 2009 20:37:01

Message: 3 of 4

That did it! Thank you!

  Adam

Subject: Getting the name of the calling funtion

From: Adam

Date: 19 May, 2009 20:37:02

Message: 4 of 4

That did it! Thank you!

  Adam

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
reference us 19 May, 2009 16:14:07
dbstack us 19 May, 2009 16:14:07
rssFeed for this Thread

Contact us at files@mathworks.com