load and assignin variables in workspace

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 日

0 投票

try
doc importdata
doc matfile

3 件のコメント

Diana Acreala
Diana Acreala 2012 年 3 月 19 日
How is this helping me? I tried to test it but no result...
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 日

0 投票

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.

カテゴリ

ヘルプ センター および File ExchangeWorkspace Variables and MAT Files についてさらに検索

質問済み:

2012 年 3 月 19 日

Community Treasure Hunt

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

Start Hunting!

Translated by