Create a new field in a structure
이전 댓글 표시
Hello,
We want to create a new field in a structure, but we don't know how to do it..
Thanks!
답변 (2개)
James Tursa
2016년 12월 1일
Not sure if this is what you are really asking:
mystruct.field1 = rand(1,3); % <-- Create a structure with field named field1
mystruct.field2 = rand(1,3); % <-- Add a new field2 to the existing structure
Image Analyst
2016년 12월 1일
Just assign something to it. Like
GRF.AdDB.Gait.time = datestr(now);
댓글 수: 3
Joran Driesen
2016년 12월 1일
Steven Lord
2016년 12월 1일
Define "doesn't work". If it threw an error, show the full and exact text of the error message (don't omit anything, don't paraphrase) and show the size and class of GRF, GRF.AdDB, and GRF.AdDB.Gait. If it issued a warning, do the same as above but with the warning message instead of the error message.
Image Analyst
2016년 12월 1일
카테고리
도움말 센터 및 File Exchange에서 Whos에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
