What does this code do?
Mostrar comentarios más antiguos
Hi there,
I am picking up on someone else's code and I am having trouble understanding the meaning of the following lines:
ereom(index,:) = [eom(index) sum(ev(ev(:,1) >= ...
bom(index) & ev(:,1) <= eom(index), 2))];
Where index is a single number, eom is a matrix with dates, bom is another a matrix with dates and ev is a (n by 2) matrix with dates on the first column and prices of a stock on the second column.
Respuesta aceptada
Más respuestas (1)
Jan
el 17 de Mayo de 2014
Set a breakpoint into this line and start the function again. When this line is reached, split this line into small parts:
t1 = eom(index)
t2 = ev(:,1) >= bom(index)
t3 = ev(:,1) <= eom(index)
t4 = t2 & t3
t5 = ev(t4)
t6 = sum(t5, 2)
ereom(index,:) = t6
This way helps to examine all long worm-like commands.
Categorías
Más información sobre Matrix Indexing en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!