seth_not@home: Matlab - Klassenmethode ändern Objektvariable

Beitrag lesen

gudn tach!

ich verzweifel hier an Matlab.

das ist normal. matlab stinkt. (zumindest war das frueher so, und afaik hat sich das nicht grossartig geaendert.)

classdef test

properties
        var = 0;
    end

methods
        function setnew(obj, newval)
            obj.var = newval;
        end
    end

end

  
laut [doku](http://www.mathworks.de/help/techdoc/matlab_oop/f2-74190.html#f2-74243) sollte die methode redundanterweise obj zurueckgeben.  
  
also  
  function obj=setnew(obj, newval)  
  
vermutlich isses das bei dir.  
  
prost  
seth