MATLAB 2020b crashing without error messages

Hello Matlab Community,
I am trying to run a MATLAB code. The first run of the code works fine. But whenever, I try to edit the code, MATLAB crashes while I am on the editor. I am not sure why?

Antworten (1)

Jan
Jan am 31 Mai 2021

0 Stimmen

If the code contains some C-mex functions, they can corrupt the memory. With some luck, Matlab can still work until a random following collision.
So please explain, if the problem is reproducible. If it is, which OS and Matlab version are you using?

1 Kommentar

Amartya Ganguly
Amartya Ganguly am 31 Mai 2021
Bearbeitet: Amartya Ganguly am 31 Mai 2021
So, some information as requested, apologies for not providing it earlier.
OS: Windows 10 64 bit, Matlab 2020b 64 bit. OpenSim 4.2 uses the MATLAB API
I was able to identify which function was causing the problem. I have entered the particular function.
function CPP = Create_CPP(Name, Body, Location, Coordinate, MaxRange, MinRange)
if nargin == 5; MinRange = 0;end
if nargin == 4; MaxRange = 0; MinRange = 0;end
if nargin < 4
fprintf('ConditionalPathPoint input for %s are not enough. \n', Name);
return
end
import org.opensim.modeling.*
if ~strcmp(Body.getClassName, 'Body') || ...
~strcmp(Coordinate.getClassName, 'Coordinate')
fprintf('Input Variables Format for %s are wrong. \n', Name);
return
end
CPP = ConditionalPathPoint();
CPP.setName(Name);
CPP.setBody(Body);
CPP.set_location(Location);
CPP.setCoordinate(Coordinate);
CPP.setRangeMax(MaxRange);
CPP.setRangeMin(MinRange);
end
in the main Matlab script the function gets called like this (a small example)
PPS_FCU = FCU.getGeometryPath.getPathPointSet();
% append ConditionalPathPoint FCU_P2
FCU_P2 = Create_CPP('FCU_P2', bs_new.get('ulna'), Vec3(-0.00465, -0.22771, 0.05589),...
cs_new.get('flexion'), 1.5708, 0.558505);
PPS_FCU.adoptAndAppend(FCU_P2);
If the above function is not used then the whole program works fine. I am not sure whether the creation or execution of the Create_CPP function is the culprit ?
The first run workds really well. The 2nd run is where MATLAB crashes, the 2nd run generally involves adding more code to create/edit/extend the code further simulations.
I hope I was able to describe the problem more clearly now.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Startup and Shutdown finden Sie in Hilfe-Center und File Exchange

Gefragt:

am 31 Mai 2021

Bearbeitet:

am 31 Mai 2021

Community Treasure Hunt

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

Start Hunting!

Translated by