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

11 visualizzazioni (ultimi 30 giorni)
  2 Commenti
Rik
Rik il 21 Gen 2023
That depends on what psi is, but with a nested loop this is trivial. What did you try?
Aynur Resulzade
Aynur Resulzade il 22 Gen 2023
Modificato: Aynur Resulzade il 22 Gen 2023
psi is 2x2 matrix which is depend on n psi(n)=(A11(n) A12(n);A21(n) A22(n))

Accedi per commentare.

Risposte (1)

Bruno Luong
Bruno Luong il 21 Gen 2023
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 Commenti
Bruno Luong
Bruno Luong il 23 Gen 2023
Modificato: Bruno Luong il 23 Gen 2023
@Aynur Resulzade You must kidding me. I'll delete my answer
Aynur Resulzade
Aynur Resulzade il 23 Gen 2023
Modificato: Aynur Resulzade il 23 Gen 2023
@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)))

Accedi per commentare.

Categorie

Scopri di più su Clusters and Clouds in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by