Mohammad - Please edit your above code so that it is a little more readable. Comments would definitely help. Please also describe the problem you are facing with the above - why isn't it doing what you want it to do? What is it supposed to do?
Some things that I noted:
The condition on your first if statement is invalid: the matrix e is not yet defined so will error out with the Undefined function or variable e. As well, what is the intent of that condition in trying to check to see if a matrix is greater than or equal to zero? Are you checking to see if all elements in it are greater than or equal to zero (and why?)?
It may be a good idea to put a breakpoint in the code - at the first line - and then step through the code to see if what is happening (at each line) is exactly what you want. For example, a matrix b is defined but unused - why? The matrix c is a 2x4 matrix then on the next line is set to zero which will cause a division by zero problem at the line
and so f is a 2x4 matrix of NaN values. The matrix a is 10x2 and yet the code
is trying to get the size of third dimension (which doesn't exist!), returning the value of one. Why?
What problem is the above code trying to solve? It may be a good idea to comment the code so that it is clear to all what the intent of each line is.