I'm evaluating a simple function:
y = (2*x)/sqrt( 1 + x.^2 );
Where x
is a vector with about 100 values in it. However, MATLAB makes y
equal to a single scalar value in this instance. If I do:
y = 2*x;
I get a vector of values in y
as expected. If I do:
y = x.^2;
I also get a vector of values in y
as expected.
Why is the above equation y = (2*x)/sqrt( 1 + x.^2 );
giving a single value and not a vector of values?