How to write codes for multiple summation in one formula?

조회 수: 1 (최근 30일)
MD. Rokibujjaman sovon
MD. Rokibujjaman sovon 2020년 12월 13일
댓글: MD. Rokibujjaman sovon 2020년 12월 13일
I am trying to write the matlab code for the following equation, but i can't do it using 'symsum' fuction. I do not understand how can i do it manually. How can i write the matlab code for the following function?
W and V is matrix. where i = 4, j = 10 k = 4.
Kindly write the for me. It will be a great help for my understanding.
Thank you.

답변 (1개)

Walter Roberson
Walter Roberson 2020년 12월 13일
You cannot do it with symsum() . You can never use a symbolic variable to index anything.
You need to instead calculate the individual values and sum() them.
Use loops if you need to. Get the code working first before you worry about whether there are ways to vectorize it.
Note:
The equations do not make sense. (i) is an input parameter on the left side, but on the right hand side, i is sometimes an input parameter and sometimes the variable of summation. This is confusing.
In the numerator, the first involves the input parameter i but in the denominator it is the i captured from the . This is confusing. And the second in both cases it is the locally captured i from the sum .
The equations need to be rewritten for clarity.
  댓글 수: 3
Walter Roberson
Walter Roberson 2020년 12월 13일
In the numerator, the first uses undefined i but the second uses the i from
MD. Rokibujjaman sovon
MD. Rokibujjaman sovon 2020년 12월 13일
That is a matrix.
and matrix.

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

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by