update the filed values in a structure

1 次查看(过去 30 天)
kittu
kittu 2012-10-21
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.

回答(1 个)

Wayne King
Wayne King 2012-10-21
编辑:Wayne King 2012-10-21
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.

类别

Help CenterFile Exchange 中查找有关 Structures 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by