Saturday, 15 September 2012

matlab - Getting variable name -



matlab - Getting variable name -

i trying create scatter plot, labeling x-axis using variable name.

i tried using r command variable name of dataset variable:

name(dsexample.variable)

but doesn't work.

i tried code given in stackoverflow question matlab string containing variable name

but got blank answer. maybe due using dataset instead of matrix, tried converting dataset variable using double() input.

what should seek next?

you can retrieve variable names in info set using get method:

data = rand(1000,2); d = dataset({data, 'random'}); scatter(data(:,1), data(:,2)); xlabel( get(d,'varname') );

matlab

No comments:

Post a Comment