Select data by attributes
3 次查看(过去 30 天)
显示 更早的评论
Hi
I have a 24000x1 Geographic Data Structure (let's call it "Polylines" with more than 20 attribute fields. I always only like to do calculations with some of the data of this stucture. Let's say I have the field "Accuracy" and now I only like to do calculation with the data which have the string "acc" in that field. I am not sure if it is important but the structure is an element-by-element-organization. How can I select these data? Thank you for your help, Claudia
0 个评论
采纳的回答
Geoff
2012-5-21
Do you mean you have a structure:
Polylines.Accuracy
Polylines.SomeOtherField1
Polylines.SomeOtherField2
... etc
And the Polylines.Accuracy field is exactly equal to the string 'acc' for all the rows you're interested in?
And the Polylines.Accuracy field is perhaps a cell array?
IF that were the case, you could do this:
validRows = strcmp( Polylines.Accuracy, 'acc' );
And then use that as a logical index on all fields you are interested in.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Structures 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!