@@ -467,8 +467,11 @@ def _process_time_response(
467467
468468 Parameters
469469 ----------
470+ sys : LTI or InputOutputSystem
471+ System that generated the data (used to check if SISO/MIMO).
472+
470473 T : 1D array
471- Time values of the output
474+ Time values of the output. Ignored if None.
472475
473476 yout : ndarray
474477 Response of the system. This can either be a 1D array indexed by time
@@ -478,9 +481,9 @@ def _process_time_response(
478481
479482 xout : array, optional
480483 Individual response of each x variable (if return_x is True). For a
481- SISO system (or if a single input is specified), This should be a 2D
484+ SISO system (or if a single input is specified), this should be a 2D
482485 array indexed by the state index and time (for single input systems)
483- or a 3D array indexed by state, input, and time.
486+ or a 3D array indexed by state, input, and time. Ignored if None.
484487
485488 transpose : bool, optional
486489 If True, transpose all input and output arrays (for backward
@@ -545,7 +548,7 @@ def _process_time_response(
545548 raise ValueError ("unknown squeeze value" )
546549
547550 # Figure out whether and how to squeeze the state data
548- if issiso and len (xout .shape ) > 2 :
551+ if issiso and xout is not None and len (xout .shape ) > 2 :
549552 xout = xout [:, 0 , :] # remove input
550553
551554 # See if we need to transpose the data back into MATLAB form
@@ -555,7 +558,8 @@ def _process_time_response(
555558
556559 # For signals, put the last index (time) into the first slot
557560 yout = np .transpose (yout , np .roll (range (yout .ndim ), 1 ))
558- xout = np .transpose (xout , np .roll (range (xout .ndim ), 1 ))
561+ if xout is not None :
562+ xout = np .transpose (xout , np .roll (range (xout .ndim ), 1 ))
559563
560564 # Return time, output, and (optionally) state
561565 return (tout , yout , xout ) if return_x else (tout , yout )
0 commit comments