Can you show examples of what you have tried?
- Buck Thorn
Have you tried two for-loops, one for i and second for j, with a condition inside, for the delta?
- Adiel
The deltas matrix, a_i and a_j you have already at memory, don't you? You can do two loops as you say, it is probably not the optimal answer for matlab, but that's the way. Add the codes your tried and what went wrong on them.
- Werner
2 Answers
1
votes
Assuming A and X are vectors of size n x 1, you could construct that expression by writing transpose(X) * (sqrt(A * transpose(A)) .* (ones(n) - eye(n))) * X.
1
votes
Another way to do this is
a = sqrt(ain); % ain is your input column vector
A = a*a.';
A = A-diag(diag(A));
aresult = x.'*A*x % x is your (other) input column vector
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.OkRead more
iand second forj, with a condition inside, for the delta? - Adiel