Hello men and women,

the next problem has got me pinned down. Following an experiment I have to calculate the uncertainty of the values and of a coupple of equations, but I just can't get it right. I already calculated the mean values of the measurement data, and that went into a new vector. However, when I use the next code, I will get error after error, particularly because I can't use vectors in it. Basically, my question is:

Is there a way to use vectors for the variables in "syms" or do I have to write an all new function? Please help me and thanks in advance!

Regards,

Yuri

The example:

` T = big matrix; s = vector; g = 9.81; ug = 0.01; udeltas = 0.005; for i=1:10 t(i) = mean(T(i,:)); ut(i) = std(T(i,:))/sqrt(length(T(i,:))); end for k=1:10 deltas(k) = s(k) - 0.5*g*(t(k))^2; end syms Bm uBm g ug deltas udeltas t ut for j=1:10 Bm(j) = -(12/(g^2))*(deltas(j)-deltas(1))/(t(j)^4 - t(1)^4); uBg(j) = ug*diff(Bm,g); uBdeltas(j) = udeltas(j)*diff(Bm,deltas); uBt(j) = ut(j)*diff(Bm,t); uBm(j) = sqrt(uBg(j)^2 + uBdeltas(j)^2 + uBt(j)^2 + uBdeltas(1)^2); end`

And, upon running I receive the following errors:

Error using mupadmex Error in MuPAD command: Index exceeds matrix dimensions.

Error in sym/subsref (line 1577) B = mupadmex('symobj::subsref',A.s,inds{:});

## Best Answer