Assignin Structures
15 ビュー (過去 30 日間)
古いコメントを表示
Greetings -
I created a structure within a function and I would like to save it back to the base work space and I get the error:
"??? Undefined function or method 'assign' for input arguments of type 'struct'."
What is a good way of getting around assignin and structures. I have the structure named 'data' and I would like to save everything it contains to the base work-space.
0 件のコメント
回答 (3 件)
the cyclist
2012 年 4 月 1 日
Well, the error refers to the function or method "assign" and not "assignin". Is it possible you made a simple typo? Can you show the actual code you used?
0 件のコメント
Image Analyst
2012 年 4 月 1 日
Assuming you really used assignin() and not assign() (of which there is no such function), are you sure you did something like
assignin('base', 'myStruct', myStruct);
Maybe you forgot to put the name of your structure variable in there twice, once with single quotes around it.
0 件のコメント
Brandon
2012 年 4 月 1 日
1 件のコメント
the cyclist
2012 年 4 月 1 日
No worries. Sometimes the silliest errors are the most difficult ones to spot. Please consider "accepting" my solution to you problem, since it does seem to have resolved the issue. Also, for future reference, it might have made sense to add your remarks as a "comment" to my answer, rather than as a separate "answer".
参考
カテゴリ
Help Center および File Exchange で Structures についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!