필터 지우기
필터 지우기

Double Sigma with an equation

조회 수: 7 (최근 30일)
Ufukcan Aravci
Ufukcan Aravci 2020년 3월 9일
답변: Paola Carranza Bravo 2021년 9월 7일
Hello people, I am very new to Matlab and got stuck to a question;
The coefficients in the matrix will be used in the equation. How can I use the code and get the answer for the eqn?
  댓글 수: 1
Ameer Hamza
Ameer Hamza 2020년 3월 9일
what is ? Is it element on i-th row and j-th column of the matrix?

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

답변 (2개)

Prasanna Gude
Prasanna Gude 2020년 3월 12일
The equation can be solved with the help of ‘for’loop and ‘sum’ function in MATLAB. The following code will solve the equation:
for j = 1:5
for i = 1:5
X(5) = x(i,j)+x(j,i)-(x(i,i)^2);
end
sum1(5) = sum(X);
end
SUM = sum(sum1);
When you are doing both the summations from 1 to 5, the matrix ‘x’ must be of size 5x5 or above.

Paola Carranza Bravo
Paola Carranza Bravo 2021년 9월 7일
for j = 1:5
for i = 1:5
X(5) = x(i,j)+x(j,i)-(x(i,i)^2);
end
sum1(5) = sum(X);
end
SUM = sum(sum1);

카테고리

Help CenterFile Exchange에서 Calculus에 대해 자세히 알아보기

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by