Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

Coding an Equation with Sum of including limitations

조회 수: 2 (최근 30일)
Harrison Dove
Harrison Dove 2020년 8월 10일
마감: MATLAB Answer Bot 2021년 8월 20일
Hi All,
Im just having trouble writing an equation in matlab that will match the following equation given. I have the values of vx and x1 imported in my data but am not sure how to write the equation so that after the value for k is input it can create such an equation. Eg if i were to input input 3 in the command window the equation should be solved as x(3) = (vx(2)(t(3)-t(2)))+(vx(1)(t(2)-t(1)))+x1. Thank you in advance
  댓글 수: 1
Deepak Gupta
Deepak Gupta 2020년 8월 10일
x(k) = sum(vx(2:end)-vx(1:end-1))+x(1)

답변 (1개)

Antoine Laurin
Antoine Laurin 2020년 8월 10일
This is unclear.
What is vx (or vxj) ? A vector ?
What is tj ? A scalar ? An integer ?
Do you want to multiply the value of vxj by the difference (tj+1 - tj) ? Or do you want to access the value of vxj for the index defined by the difference (tj+1 - tj) ?

이 질문은 마감되었습니다.

제품

Community Treasure Hunt

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

Start Hunting!

Translated by