I don't have the symbolic toolbox so I can't run it, but one error I see right off the bat is that you're not using a doubl equals
else [X]=0
should be
else X == 0
Additionally, you don't need square brackets around variables.
And if X is a multi-element array, you'll need to use any(X) or all(X) depending if you want to go in there if 1 or more values are 0, or if you need all values to be zero.