Combining fields of a struct
显示 更早的评论

How do I combine the two fields of "close" into a 252X2 double?
Thanks
回答(1 个)
[stocks.Close]
It really is that simple. Here is a working example:
>> A(1).x = rand(4,1);
>> A(2).x = rand(4,1);
>> [A.x]
ans =
0.27603 0.119
0.6797 0.49836
0.6551 0.95974
0.16261 0.34039
And the relevant documentation (recommended reading!):
类别
在 帮助中心 和 File Exchange 中查找有关 Structures 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!