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

조회 수: 1 (최근 30일)
Aynur Resulzade
Aynur Resulzade 2023년 1월 20일
편집: Aynur Resulzade 2023년 1월 23일
  댓글 수: 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
Bruno Luong
Bruno Luong 2023년 1월 23일
편집: Bruno Luong 2023년 1월 23일
@Aynur Resulzade You must kidding me. I'll delete my answer
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)))

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Correlation and Convolution에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by