How to create a structure with a name speficied by user in inputdlg?

3 ビュー (過去 30 日間)
Flávio
Flávio 2013 年 2 月 6 日
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
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
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 = []']);

カテゴリ

Help Center および File ExchangeStructures についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by