@@ -467,8 +467,11 @@ def _process_time_response(
467
467
468
468
Parameters
469
469
----------
470
+ sys : LTI or InputOutputSystem
471
+ System that generated the data (used to check if SISO/MIMO).
472
+
470
473
T : 1D array
471
- Time values of the output
474
+ Time values of the output. Ignored if None.
472
475
473
476
yout : ndarray
474
477
Response of the system. This can either be a 1D array indexed by time
@@ -478,9 +481,9 @@ def _process_time_response(
478
481
479
482
xout : array, optional
480
483
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
482
485
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.
484
487
485
488
transpose : bool, optional
486
489
If True, transpose all input and output arrays (for backward
@@ -545,7 +548,7 @@ def _process_time_response(
545
548
raise ValueError ("unknown squeeze value" )
546
549
547
550
# 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 :
549
552
xout = xout [:, 0 , :] # remove input
550
553
551
554
# See if we need to transpose the data back into MATLAB form
@@ -555,7 +558,8 @@ def _process_time_response(
555
558
556
559
# For signals, put the last index (time) into the first slot
557
560
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 ))
559
563
560
564
# Return time, output, and (optionally) state
561
565
return (tout , yout , xout ) if return_x else (tout , yout )
0 commit comments