Base workspace variable name

4 visualizaciones (últimos 30 días)
Gopalakrishnan venkatesan
Gopalakrishnan venkatesan el 4 de Dic. de 2015
Editada: Gopalakrishnan venkatesan el 4 de Dic. de 2015
Is there any command to get the base workspace variable name ?
  2 comentarios
Guillaume
Guillaume el 4 de Dic. de 2015
In which contest? within a function? Which variable? All of them? An input to a function?
Gopalakrishnan venkatesan
Gopalakrishnan venkatesan el 4 de Dic. de 2015
Editada: Gopalakrishnan venkatesan el 4 de Dic. de 2015
I have a function like below
function data()
run('D:\......\comp.m')
end
so now comp.m will run and store the repective variable in base workspace.
Problem is now i need to get the name of the base workspace variables

Iniciar sesión para comentar.

Respuesta aceptada

Thorsten
Thorsten el 4 de Dic. de 2015
Editada: Thorsten el 4 de Dic. de 2015
S = whos;
varname = {S.name};
  5 comentarios
Guillaume
Guillaume el 4 de Dic. de 2015
"use evalin": Here be dragons. Do not go down that path unless you know what you're doing and know all the pitfalls of using eval and its friends.
For what reasons do you want to have the list of variables in the base workspace?
Gopalakrishnan venkatesan
Gopalakrishnan venkatesan el 4 de Dic. de 2015
Editada: Gopalakrishnan venkatesan el 4 de Dic. de 2015
I have a function like below
function data()
run('D:\......\comp.m')
end
so now comp.m will run and store the repective variable in base workspace only right. I need the variable name so oly. Like wise this will run in loops

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Scope Variables and Generate Names en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by