Verfasst am: 13.09.2011, 09:07
Titel: Endlosschleife - was tun?
Guten Morgen,
ich komme seit Tagen immer wieder in diese Endlosschleife:
Code:
>> A(MSAstruct);
Warning: The class file for 'mPF' has been changed; but the
change cannot be applied because objects based on the old class file still
exist. If you use those objects, you might get unexpected results. You can
use the 'clear' command to remove those objects. See 'help clear' for
information on how to remove those objects.
> In mP>mP.mP at 36
In mPF>mPF.mPF at 14 % kommt 500 mal oder so
In mP>mP.mP at 36
In mPF>mPF.mPF at 14
In mS>mS.mS at 74
In A>A.A at 60
% kommt auch ganz oft (falls noch alte Objekte existieren)
Warning: The class file for 'mPF' has been changed; but the
change cannot be applied because objects based on the old class file still
exist. If you use those objects, you might get unexpected results. You can
use the 'clear' command to remove those objects. See 'help clear' for
information on how to remove those objects.
> In mP>mP.mP at 36
In mPF>mPF.mPF at 14 % kommt 500 mal ungefähr
In mP>mP.mP at 36
In mPF>mPF.mPF at 14
In mS>mS.mS at 74
In A>A.A at 60
??? The following error occurred converting from mP to
mPF:
The following error occurred converting from mP to mPF:
% kommt 100 mal ungefähr
The following error occurred converting from mP to mPF:
The following er
classdef mP
properties
name
end
methods
function obj = mP(einstruct) ifnargin > 0
n = size(einstruct, 2); % Zeile 36
obj(1,n) = mP;
for i=1:n
obj(1,i).name = einstruct(1,i).name;
end end end end end
mPF sieht so aus:
Code:
classdef mPF < mP & F
properties
end
methods
function obj = mPF(einstruct)
obj = obj@mP(einstruct); % Zeile 14 end end end
Das genügt an Code, oder?
Ich hoffe, jemand findet meinen Fehler und bin dankbar für die Mühe.
Schöne Grüße, Anoa
einstruct <1x1 struct>:
t [0,0;1,198.8524;2,1.00...
St <1x2 struct>
CI <1x1 struct>
Se <1x1 struct>
in diesen Structs sind jeweils wieder Structs, Cells und Doubles.
Ich möchte eigentlich nur solche Structs mithilfe der Konstruktoren als Objekte speichern. Dadurch dass die Klassen aber teilweise voneinander abgeleitet sind, muss ich z.B. im mPF-Konstruktor den mP-Konstruktor aufrufen und ich glaube, da schleicht sich die Endschlossschleife irgendwie rein.
Options and Permissions
Du kannst Beiträge in dieses Forum schreiben. Du kannst auf Beiträge in diesem Forum antworten. Du kannst deine Beiträge in diesem Forum nicht bearbeiten. Du kannst deine Beiträge in diesem Forum nicht löschen. Du kannst an Umfragen in diesem Forum nicht mitmachen. Du kannst Dateien in diesem Forum posten Du kannst Dateien in diesem Forum herunterladen
MATLAB, Simulink, Stateflow, Handle Graphics, Real-Time Workshop, SimBiology, SimHydraulics, SimEvents, and xPC TargetBox are registered trademarks and The MathWorks, the L-shaped membrane logo, and Embedded MATLAB are trademarks of The MathWorks, Inc.