How to dynamically create a struct?
이전 댓글 표시
I want to create a struct with the number of fields decided based on some user input. What's a good way of doing this? Or should I be using a cell or matrix instead?
Thanks
채택된 답변
추가 답변 (1개)
Walter Roberson
2017년 2월 1일
TheStructure = cell2struct( cell(1, length(NamesCell)), NamesCell, 2 )
카테고리
도움말 센터 및 File Exchange에서 Structures에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!