Matlab get string containing variable name


This question already has an answer here:


MATLAB doesn't provide built-in functionality for this, but there is a workaround, as employed here

Essentially, you have to create your own function to do this. Take advantage of Matlab's functionality for getting the variable name of the INPUT ARGUMENT to a function.


function out = varname(var)
  out = inputname(1);


GRUMPY = 500;
name = varname(GRUMPY)

will give you what you want.

If I understand correctly you should try



which GRUMPY 

Need Your Help

WPF or Windows Forms

c# wpf windows winforms c#-4.0

I've been playing around with C# console applications for about a year and I want to move on to creating GUI applications. I have never done any GUI development besides basic Java applications, but I

mysql select records greater than 3 months

php sql mysql

I am trying to write a query to select all records from users table where User_DateCreated (datetime field) is >= 3 months from today.