update the filed values in a structure

1 view (last 30 days)
kittu
kittu on 21 Oct 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.

Answers (1)

Wayne King
Wayne King on 21 Oct 2012
Edited: Wayne King on 21 Oct 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.

Categories

Find more on Files and Folders in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!