Hi. How I can write this formula with Matlab code?

2 次查看(过去 30 天)
  2 个评论
Rik
Rik 2023-1-21
That depends on what psi is, but with a nested loop this is trivial. What did you try?
Aynur Resulzade
Aynur Resulzade 2023-1-22
编辑:Aynur Resulzade 2023-1-22
psi is 2x2 matrix which is depend on n psi(n)=(A11(n) A12(n);A21(n) A22(n))

请先登录,再进行评论。

回答(1 个)

Bruno Luong
Bruno Luong 2023-1-21
n=10;
psi=rand(1,n-2);
chi = 0;
for k=1:n-2
i = nchoosek(1:n-2,k);
j = 1:k;
l = k+1-j;
il = i(:,l);
chi = chi+sum(prod(psi(il),2));
end
chi
chi = 11.2726
% Or remove some of the unecessary indexing with j and l
chi = 0;
for k=1:n-2
chi = chi+sum(prod(psi(nchoosek(1:n-2,k)),2));
end
chi
chi = 11.2726
  4 个评论
Aynur Resulzade
Aynur Resulzade 2023-1-23
编辑:Aynur Resulzade 2023-1-23
@Bruno Luong please excecuse me
Sorry I ask second time this question for 2x2 matrix where fi
admin say that you must ask for this in after question and didnt accept answer
that is way I unaccept ((((((
please help me for this problem and don't angry)))

请先登录,再进行评论。

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by