Can somebody show me how to write a script to calculate the following function of N? It just confuses me a bit because if N is an even number then it may very well be the the lower and upper index are not integers... I don't know what the best way to deal with this hurdle is, perhaps make the function go from a negative integer to a positive integer then make a necessary substitution??
I'm not sure.. But i'd love to see what you guys come up with. I'm slowly learning how to write basic programs, but this one is a bit out of my league, and I'd appreciate if somebody could show me how
p.s. how do I make the LaTeX formatting turn on??

댓글 수: 4

Ameer Hamza
Ameer Hamza 2020년 9월 26일
You can input the latex equation by eclosing the latex string in $$ on the same line. You can also use the Sigma button at the top of this textbox.
About your question: you should follow same method as answer by Alan to your other question here: https://www.mathworks.com/matlabcentral/answers/600322-need-help-programming-a-few-tricky-calculations?s_tid=srchtitle
it's different though, because now my summation might be going from a non integer value to a non integer value, how do I get around that obstacle?
David Hill
David Hill 2020년 9월 26일
편집: David Hill 2020년 9월 26일
Works fine for N (odd). Where did you get the equation? Are you sure there is not another equation for N (even). The above equation does not work for N (even).
The equation is from a reputable source, a paper of https://en.wikipedia.org/wiki/Efstratia_Kalfagianni
It is implied that you take the sum as j increases by 1 at each iteration of the summation. Since the top and bottom index are opposites of eachother, this is well defined

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

 채택된 답변

Alan Stevens
Alan Stevens 2020년 9월 26일

0 개 추천

Simply let k = 2j and then you can write:
This will hold for both N even and N odd.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

태그

질문:

2020년 9월 26일

답변:

2020년 9월 26일

Community Treasure Hunt

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

Start Hunting!

Translated by