u is an input from the output of continous state.so, for each time (1 x 3) matrix will come out, so
u matrix = 1 x 3
Mean = 1 x 450
is a mean of samples.This input from workspace which consist 150 times with 3 variables so its matrix is (1 x 450). but we only need (1 x 3) matrix to evaluate for each time
Std = 1 x 450
is a standard deviation of samples.Same description as above(mean)
Xnew = 1x3
is an outpyt from the equation Xnew = u-mean/std
for time 1
Xnew = u-Mean(1,1:3)
Xnew = u-Mean(1,4:6);
untill time 150
i'm trying to do loop in embedded matrix function as below command:
function Xnew = stats(u,Mean, Std) %#eml
for j=1:150, Xnew = (u-Mean(1,j:j+2))./Std(1,j:j+2); end
unfortunately i received this error,
"Could not determine the size of this expression"
I'm doing looping because i want to pick the submatrix that will be used in the equation.
What should i change above command so as i can get the result as i want? anybody have idea?
Strange. This works fine for me (I'm using R2011b). Perhaps you are using an older version of MATLAB? What about if you pre-allocate Xnew at the top of the function:
Xnew = zeros(1,3);