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

3 次查看(过去 30 天)
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?

采纳的回答

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