Convert MATLAB code to mathematical notation

Hi!
I have a matlab code that I would like to write as a mathematical function. Unfortunately I'm not good with mathematical notations, and I'm not really sure where to begin - so any help would be much appreciated.
I have an array (for example):
x = [-1, 3, 2, 5, 6, 7, 9, 8, 6, 4, 1, -2, 0, 1];
I executed the following code on this array:
[~,latency_index] = min(abs(cumsum(x)-sum(x)/2));
The output I'm interested in is the latency_index. How can I write this code with mathematical notations?
Thank you very much in advance!

답변 (1개)

Walter Roberson
Walter Roberson 2022년 7월 9일

1 개 추천

Most commonly the second output of min() of a vector would be referred to as "argmin"

카테고리

도움말 센터File Exchange에서 Logical에 대해 자세히 알아보기

제품

릴리스

R2022a

질문:

2022년 7월 9일

답변:

2022년 7월 9일

Community Treasure Hunt

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

Start Hunting!

Translated by