how to get the result as a vector
2 views (last 30 days)
Hi, Im generating normal random numbers into a matrix and then perform a calculation on each column of the matrix. My problem is that the result is just a single number and should be a vector of numbers one for each column. here is my code
j = [1:q(1)];
result = -q(1)-(1/q(1))*sum((j*2-1).*(log(normcdf(Z(j),0,1))+log(1-normcdf(Z(q(1)+1-j),0,1))))
The "result" just comes out as a single number where as I'm trying to get it as a vector, in the above code a vector with 10 entries.
Where am I going wrong?