Base workspace variable name

4 ビュー (過去 30 日間)
Gopalakrishnan venkatesan
Gopalakrishnan venkatesan 2015 年 12 月 4 日
Is there any command to get the base workspace variable name ?
  2 件のコメント
Guillaume
Guillaume 2015 年 12 月 4 日
In which contest? within a function? Which variable? All of them? An input to a function?
Gopalakrishnan venkatesan
Gopalakrishnan venkatesan 2015 年 12 月 4 日
編集済み: Gopalakrishnan venkatesan 2015 年 12 月 4 日
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

サインインしてコメントする。

採用された回答

Thorsten
Thorsten 2015 年 12 月 4 日
編集済み: Thorsten 2015 年 12 月 4 日
S = whos;
varname = {S.name};
  5 件のコメント
Guillaume
Guillaume 2015 年 12 月 4 日
"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 2015 年 12 月 4 日
編集済み: Gopalakrishnan venkatesan 2015 年 12 月 4 日
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

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeVariables についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by