??How to get the Name of the Output to the left of the equal sign??

Hallo everyone,
I am now searching a way to get the Name of the output to the left of the equal sign in a function.
For example, I call a function like this:
OutputName = myfun(input1, input2)
Is it possible, that I can get the name "OutputName" in "myfun" and use it? It means, my function should know the name "OutputName" when it is called.
how to realize it?
thanks and regard! Zhang

Answers (1)

The short answer is NO followed by a question WHY.
The long answer is maybe:
  1. dbstack(2) has the name of the caller and the line number
  2. which('name') will provide the full file specification
  3. read the file and parse the line
but why would you want to do something like that?

Categories

Find more on MATLAB in Help Center and File Exchange

Asked:

on 2 Jun 2012

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!