Is there a way to "pass by value" from a handle class?

조회 수: 3 (최근 30일)
Sam
Sam 2017년 9월 10일
답변: Walter Roberson 2017년 9월 10일
If I have a class, "MyClass" as a subclass to the handle class, how can I pass the variable "a" out by value using R2014a?
  댓글 수: 1
per isakson
per isakson 2017년 9월 10일
편집: per isakson 2017년 9월 10일
  • what kind of variable is a ?
  • what kind of value does a have ?

댓글을 달려면 로그인하십시오.

채택된 답변

Walter Roberson
Walter Roberson 2017년 9월 10일
Construct a parallel non-handle class with equivalent properties and methods, and invoke its constructors with the properties of the handle class object to create a non-handle equivalent.
This presumes that when you say "pass by value" that it will not be necessary for the routine being passed into to modify the original object using evalin() or assignin() with the expectation that that would change the handle version as well.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Software Development Tools에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by