Divide consecutive numbers and put them in a table
5 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
TotalReturnIndexLevel
_____________________
12/31/2019 100
1/31/2020 90.3
2/28/2020 104.75
3/31/2020 115.01
4/30/2020 123.18
5/31/2020 139.81
6/30/2020 131.28
7/31/2020 137.71
8/31/2020 145.56
How can I divide consecutive numbers and put them in a table.
For example
90.3/100 = 0.903
104.75/90.3 = 1.16
But make it automatic for a long list and put the outcomes in a table
0 Commenti
Risposte (1)
Image Analyst
il 19 Feb 2022
Modificato: Image Analyst
il 19 Feb 2022
Assuming v is your vector of numbers
ratios = v(2:end) ./ v(1:end-1)
% Create table
t = table(ratios(:), 'VariableNames', {'Ratios'})
0 Commenti
Vedere anche
Categorie
Scopri di più su Loops and Conditional Statements in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!