阅读背景:

Matlab OOP:如何更新对象的属性

来源:互联网 
classdef PortfolioX 
       properties 
          name; 
          anzahl=0; 
          myValue=0; 
          handeln; 
          preis=0; 
       end 

  function [this, portfolio1] = setAnzahl(this, portfolio1, AktienAnzahl, AktienPreis) 
  .... 
  this.preis = AktienPreis; 
  portfolio1.value = AktienAnzahl;
   ... 
   end
end



function StartTrading(DDD, Portfolio) 
%if text.mat 
load test.mat 
%end 

%Aktie = DDD; 
DDD.handeln = 'buy'; 
    %Anzahl an Aktien die gehandelt werden und deren aktueller Preis 
    [DDD, Portfolio] = setAnzahl(DDD, Portfolio, 200, 5); 

    save test.mat 
load test.mat 
classdef PortfolioX 
       properties 
       



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: