필터 지우기
필터 지우기

Base workspace variable name

조회 수: 6 (최근 30일)
Gopalakrishnan venkatesan
Gopalakrishnan venkatesan 2015년 12월 4일
편집: 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 CenterFile Exchange에서 Variables에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by