input to structures
6 次查看(过去 30 天)
显示 更早的评论
Domain.x='xxxxx';
Domain.y='18 May 2012';
Domain.z='zzz';
Domain.t='tttttt';
Hi, i know how i make structure like up. But i dont know how i can use input function and take "x","y","z","t" variables from users with my GUI ?
0 个评论
采纳的回答
更多回答(1 个)
Walter Roberson
2012-5-20
thisfieldname = input('Enter the field you want to change','s');
thisval = input(['Enter the value you want to associate with ' thisfieldname]);
Domain.(thisfieldname) = thisval;
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Structures 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!