How to code difference quotients in matlab?
조회 수: 6 (최근 30일)
이전 댓글 표시
I have a vector U and I want to take its difference quotient at a time instance j i.e. I want to find dU as shown below. How can it be done?
Thank you guys in advance!
댓글 수: 0
채택된 답변
Jonas
2022년 6월 13일
elementwise differences of consecutive elements can be calculated using diff() command
댓글 수: 2
Image Analyst
2022년 6월 14일
U = randi(9, 1, 10)
% Compute difference
du = diff(U)
% Compute variance
varU = var(du)
Not sure what you mean by ratio. A ratio is a fraction of something divided by something. What are you ratioing? The ratio of a single number -- the variance -- doesn't make sense.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Numerical Integration and Differential Equations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!