Thread Subject: Getting the called function as a string.

Subject: Getting the called function as a string.

From: Adam

Date: 3 May, 2009 18:35:01

Message: 1 of 3

Hello,

Let's say one has a function x(a,b).

Let's also say that the function is called with a = [1 2 3], and b 'hello'.

Is it possible to get within the function x a string that shows exactly how the function was called? In this case, the string would be: x([1 2 3], 'hello')

Thank you!

    Adam

Subject: Getting the called function as a string.

From: Steven Lord

Date: 4 May, 2009 02:25:17

Message: 2 of 3


"Adam " <king@cs.fairfield.edu> wrote in message
news:gtko4l$4lh$1@fred.mathworks.com...
> Hello,
>
> Let's say one has a function x(a,b).
>
> Let's also say that the function is called with a = [1 2 3], and b
> 'hello'.
>
> Is it possible to get within the function x a string that shows exactly
> how the function was called? In this case, the string would be: x([1 2 3],
> 'hello')

No. You can get close in some circumstances with the INPUTNAME function,
but there's no way to do exactly what you described.

--
Steve Lord
slord@mathworks.com

Subject: Getting the called function as a string.

From: Adam

Date: 7 May, 2009 05:02:02

Message: 3 of 3

Thank you for your help.

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