How to save portfolio objects to an array?
이전 댓글 표시
p = Portfolio;
c = Portfolio;
d = [p c]
How do i store objects in an array and then extract any specific object from that array? I want to do this.
d.p.BuyCost
Thanks.
댓글 수: 1
dpb
2022년 10월 8일
Indexing; don't compound-nest similar structs; that will become totally unworkable.
d(2).BuyCost
You can create an associated name array to use as id if want a way to find specific element of the array or add that ID as a field.
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Specify Portfolio Constraints에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!