Reputation: 891
So say I have variables with variable names like SWCF and LWCF. Is there a way that I can convert these variable names into strings? I'd like to do this so that I can run functions on the variables - and have the plot titles include the variable name.
Upvotes: 0
Views: 12554
Reputation: 26069
their names are already of class char
. For example if you clear all and dont have any variable in memory:
SWCF = rand(10)
a = whos
a(1).name
so you can use title(a(1).name)
in your plot etc...
Upvotes: 1