MATLAB: ??? Subscript indices must either be real positive integers or logicals.

error message

What should I do if this error message pops up?
??? Subscript indices must either be real positive integers or logicals.

Best Answer

In the fellowing expression you missed * x0*(z, instead of x0(z
c1=(v0+x0*(z*n+n*sqrt(z.^2-1)))/(2*n*sqrt(z.^2-1));
You have also, to replace some multiplication by multiplication element/element
Related Question