Get data out of a struct to manipulate
2 次查看(过去 30 天)
显示 更早的评论
I have created a struct where the first bit is just a name, and the second bit is a bunch of data
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1434573/image.png)
I want to get the data out of the struct so I can manipulate it and put it into a table or an array
0 个评论
回答(1 个)
Cris LaPierre
2023-7-14
Extract the data using the structurename.fieldname syntax. See here: https://www.mathworks.com/help/matlab/matlab_prog/create-a-structure-array.html
% create the structure
patient.test = [79 75 73; 180 178 177.5; 220 210 205]
% Extract the data
data = patient.test
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!