필터 지우기
필터 지우기

load and assignin variables in workspace

조회 수: 3 (최근 30일)
Diana Acreala
Diana Acreala 2012년 3월 19일
Hello!
What can I use instead of the 'load(*.mat)' command? I want to load a mat file in workspace and after that to assignin all these variables (parameters) because at a given moment I need to get the variable values by using the 'evalin' command..
Thanks! Diana

답변 (2개)

Jisha
Jisha 2012년 3월 19일
try
doc importdata
doc matfile
  댓글 수: 3
Jisha
Jisha 2012년 3월 19일
the above commands open the documentation for importdata and matfile.
Walter Roberson
Walter Roberson 2012년 3월 19일
Discussion in the original question of "assignin" and "evalin" imply that Diana is attempting to store the values in to a different workspace. importdata() and matfile() do not help in storing values to a different workspace.

댓글을 달려면 로그인하십시오.


Walter Roberson
Walter Roberson 2012년 3월 19일
Using assignin() and evalin() are discouraged. "Poofing" variables into workspaces can have a number of odd side effects, and makes the code difficult to read. It would be better to load() the .mat into a structure and return the structure from the function call and access the fields of the structure.

카테고리

Help CenterFile Exchange에서 Workspace Variables and MAT-Files에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by