Filter löschen
Filter löschen

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

2 Ansichten (letzte 30 Tage)
Sam
Sam am 10 Sep. 2017
Beantwortet: Walter Roberson am 10 Sep. 2017
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 Kommentar
per isakson
per isakson am 10 Sep. 2017
Bearbeitet: per isakson am 10 Sep. 2017
  • what kind of variable is a ?
  • what kind of value does a have ?

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 10 Sep. 2017
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.

Weitere Antworten (0)

Kategorien

Mehr zu Entering Commands finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by