Do built-in classes have hidden properties storing "dimension information," and how can I find these hidden properties?
조회 수: 1 (최근 30일)
이전 댓글 표시
Do built-in classes have hidden properties storing "dimension information," and how can I find these hidden properties?
This is evidence that built-in classes property store object dimension data, which cannot be cleared even with the `empty` method.
A=double.empty(5,0);
size(A)
ans =
5 0
However, I experimented with two methods and couldn't find this property that stores "dimension data."
properties(A)
没有 double 类的属性。
mc=?A
I opened mc but couldn't find any properties related to "dimension data."
댓글 수: 0
답변 (1개)
Walter Roberson
2023년 8월 29일
It is not stored as a named property; it is stored in the fundamental descriptor along with the information such as whether the array is complex valued.
When you create your own class you can define your own size and numel methods
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Construct and Work with Object Arrays에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!