Hi,
habe eine kleine MEX - Funktion geschrieben die später (!) einmal externe Messdaten zur Verbesserung von Prognose-Entscheidungen integrieren soll.
Aktuell kommen jedoch noch BEIDE Daten aus dem Aufruf und sollen in dieser MEX Funktion zunächst aus dem Objekt extrahiert, und dann weiterverarbeitet werden.
for(i = 0; i <= schnitt; i++){
mxSetCell(plhs[0], i, mxGetCell(lsg_a, i));
mxSetCell(plhs[0], i + mrows, mxGetCell(lsg_a, i + mrows));
mxSetCell(plhs[1], i, mxGetCell(lsg_b, i));
mxSetCell(plhs[1], i + mrows, mxGetCell(lsg_a, i + mrows));
}
for(i = schnitt + 1; i<=mrows; i++){
mxSetCell(plhs[0], i, mxGetCell(lsg_b, i));
mxSetCell(plhs[0], i + mrows, mxGetCell(lsg_b, i + mrows));
mxSetCell(plhs[1], i, mxGetCell(lsg_a, i));
mxSetCell(plhs[1], i + mrows, mxGetCell(lsg_a, i + mrows));
} }
Die Funktion wird anstandslos von Matlab kompiliert. Sie liefert nach Aufruf auch das korrekte Ergebniss, jedoch verabschiedet Matlab sich anschließend mit einem
Code:
------------------------------------------------------------------------
Segmentation violation detected at Mon Jul 2616:58:122010
------------------------------------------------------------------------
Configuration:
MATLAB Version: 7.9.0.529(R2009b)
MATLAB License: 355462
Operating System: Microsoft Windows Vista
Window System: Version6.1(Build 7600)
Processor ID: x86 Family 6 Model 7 Stepping 10, GenuineIntel
Virtual Machine: Java 1.6.0_12-b04 with Sun Microsystems Inc. Java HotSpot(TM)64-Bit Server VM mixed mode
Default Encoding: windows-1252
Please follow these steps to report this problem to The MathWorks so we
have the best chance of correcting it:
The next time MATLAB is launched under typical usage, a dialogbox will
open to help you send the errorlog to The MathWorks. Alternatively, you
can send an e-mail to segv@mathworks.com with the following file attached:
C:\Users\******\AppData\Local\Temp\matlab_crash_dump.8328
If the problem is reproducible, please submit a Service Request via:
http://www.mathworks.com/support/contact_us/ts/help_request_1.html
A technical support engineer might contact you with further information.
Thank you for your help. MATLAB may attempt to recover, but even if recovery appears successful,
we recommend that you save your workspace and restart MATLAB as soon as possible.
versuche doch mal, Dein Programm zu debuggen.
Lasse z.B. doch mal die zweite FOR-Schleife weg und prüfe, ob Matlab immer noch verwirrt wird.
Dann kannst Du noch anzeigen lassen, wie oft die Schleifen denn aufgerufen wird. So weit ich dass sehe, läuft i von 0 bist mrows, also mrows + 1 mal. Ist das so gewollt?
Gruß, Jan
Einstellungen und Berechtigungen
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.