update the filed values in a structure

1 visualizzazione (ultimi 30 giorni)
kittu
kittu il 21 Ott 2012
Hi, i have a structure which has the number of field values depending on the blobs it identifies. But, in some the frames, i run my algorithm to identify hidden blobs. Now, i need to update the field of my structure with the values of newly found blobs. eg if i have a field named "Area" and i find that its values in a certain frame are 34,36,40,39 and in another frame i find that 34,36,79. This means that the 78 blob is combined with 2 blobs. So my algorithm separates the blobs but now i need to update my structure with the new values.
Any help would be highly appreciated.

Risposte (1)

Wayne King
Wayne King il 21 Ott 2012
Modificato: Wayne King il 21 Ott 2012
You can access the field with
mystruct.Area
So why can't you just update the field
mystruct = struct('Area',[34 36 40 39]);
mystruct.Area = [34 36 79];
If the problem is more involved than that, please include a small code example to illustrate the error.

Categorie

Scopri di più su Structures in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by