For the purpose of a satellite orbit simulation I am using the NRLMSISE-00 atmosphere model from the Simulink Aerospace blockset to calculate the general density (output 6 out of 9 is the only output I use, the rest are terminated, including the temperature). The simulation runs fine and I recieve reasonable values when outputted directly to the workspace. The problem starts when I try and use the density value in the same simulation. When I do this the simulation never ends and stops running on the 17th iteration. I see this only when I cancel the simulation (ctrl+c). If I don't cancel the simulation it doesn't finish or show any errors. The output value is a 1X1XN array so I tried to convert the array to a standard 1XN array but it still made no difference. At the moment what I do is run the simulation on the atmosphere and save the output array, then run the rest of the simulation and use the saved values from the previous run, this is very time consuming and inefficient. Any ideas?