MATLAB: Deleting rows and columns of all zeroes in a symbolic matrix

deleting rows and columnssymbolic

Hello,
How can I delete all rows and columns of all zeroes in a symbolic matrix?
The solution listed here ( http://www.mathworks.com/matlabcentral/answers/40018-delete-zeros-rows-and-columns ) does not work when the matrix is symbolic. The any command produces an error "Unable to prove variable-name literally."
Thanks, Kevin

Best Answer

syms x1
data = [ x1, 1, 0 ; 0, 0, 0 ; 0, 1, 0]
data( all( isAlways(data==0) ,2) ,:) = []
data( : ,all( isAlways(data==0) ,1)) = []