Create a new field in a structure
Ältere Kommentare anzeigen
Hello,
We want to create a new field in a structure, but we don't know how to do it..
Thanks!
Antworten (2)
James Tursa
am 1 Dez. 2016
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
1 Kommentar
Joran Driesen
am 1 Dez. 2016
Image Analyst
am 1 Dez. 2016
Just assign something to it. Like
GRF.AdDB.Gait.time = datestr(now);
3 Kommentare
Joran Driesen
am 1 Dez. 2016
Steven Lord
am 1 Dez. 2016
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
am 1 Dez. 2016
Kategorien
Mehr zu Whos finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
