diff --git a/matlab/get_minimal_state_representation.m b/matlab/get_minimal_state_representation.m
index fa25648842ee6a08a2061593bda14a485eb267a8..1ce6da53cae2acf1b55daa5e10e13cd342bd0e72 100644
--- a/matlab/get_minimal_state_representation.m
+++ b/matlab/get_minimal_state_representation.m
@@ -253,7 +253,9 @@ function [abar,bbar,cbar,t,k] = ControllabilityStaircaseRosenbrock(a, b, c, tol)
for jj = 1 : ra
[uj,sj,vj] = svd(bjn1);
[rsj,csj] = size(sj);
- p = flip(eye(rsj),2);
+ %p = flip(eye(rsj),2);
+ p = eye(rsj);
+ p = p(:,end:-1:1);
p = permute(p,[2 1 3:ndims(eye(rsj))]);
uj = uj*p;
bb = uj'*bjn1;