getfield to get values from an entire struct array?
显示 更早的评论
I have an array of objects of type Peak. Given the name of a field (I will be using several in turn), I would like to get the value of that field for every object in the array, resulting in a vector of double. Is there any way to ask getfield to do that, without resorting to a for loop? Or is there some related function that would do the job for me?
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Structures 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!