How to create a structure with a name speficied by user in inputdlg?
4 次查看(过去 30 天)
显示 更早的评论
So I ask what is the name of the structure in an inputdlg, the result is a cell array. The field is named always 'Course' and I want to create a structure named specifiedname.Course=[].
Is it possible to do?
1 个评论
Image Analyst
2013-2-6
Why would you want to do that? It would just complicate your program, though I think you can do it with dynamic structure names, but again, it's just unnecessary complication.
回答(1 个)
Dan K
2013-2-6
Folks, please don't crucify me for this one, but the easiest way I see to do it is:
eval([specifiedname '.Course = []']);
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Structures 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!