Need help with implementing a formula

조회 수: 1 (최근 30일)
Imtiaz nabi
Imtiaz nabi 2021년 10월 27일
답변: Jaya 2021년 10월 27일
Hi there,
I am trying to implement an algorithm using Matlab but I don't know how to write a code for the following picture.
The main confusion is the iteration and loops used in the below picture.
You can take any dummy values for the demo purpose just let me know how to implement the following formula
Thank you

채택된 답변

Jaya
Jaya 2021년 10월 27일
Maybe I got your question wrong and missing something complex in the equations. But my comment would be using two for loops. Outer one for index i=1:n and inner one for j=1:n. This might not be an elegant way of doing it or maybe have some mistales but do comment if you have doubt. I can try to improve.
for i=1:n
%compute S(i), assuming you have some formula for that
for j=1:n
%compute your S(i,j) if you have some formula for that
end
%compute you c(i)
%compute your d(i)
%I assume you can compute vj term outside these two loops code in a separate j=1:n for loop.
end

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by