Friend Function implementation in MATLAB
조회 수: 14 (최근 30일)
이전 댓글 표시
Typically, the private properties of a class are not accessible by any other class or function from outside.
But, a friend function can be granted special access to private and protected members of a class in C++.
For further reference: https://en.cppreference.com/w/cpp/language/friend
Is there any way, I can implement this in MATLAB?
It would be really helpful if anyone could provide a sample code illustrating the implementation in MATLAB.
Thanks in advance.
댓글 수: 0
채택된 답변
Pavan Sahith
2024년 8월 1일
편집: Pavan Sahith
2024년 8월 2일
Hello ,
I see that you are trying to achieve similar functionality of C++ friend functions in MATLAB.
In MATLAB, you can grant specific classes access to private properties and methods of another class by using access control lists. This might be helpful for your needs.
Referring to the following MATLAB answer post and MathWorks documentation will help
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Software Development Tools에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!