If x is a vector or array, then you are trying to compute element-wise operations. But / and ^ and * are all operators that are defined in terms of MATRIX multiplies and linear algebra.
Use the ./ .^ and .* operators for element-wise operations.
Ideas like this would be found in the getting started tutorials for MATLAB. Essenitally, it is always a good idea to read the manual.