Finding the delta (subtraction) of two cells in an existing matrix
15 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
itzhak mal
am 16 Apr. 2019
Kommentiert: Star Strider
am 16 Apr. 2019
Hi,
I have a matrix with 10^7 rows and 17 columns.
Column number 17 is the time and I want to add another column, 18, that will have the delta of these time steps..
for example:
1
5
15
will yield
4
10
I get do loops cause there are 10^7 million rows.. it would take ages. Any ideas? Perhaps a boolian expression would do the trick? Thanks!!!
0 Kommentare
Akzeptierte Antwort
Star Strider
am 16 Apr. 2019
time = [ 1
5
15]
dtime = [0; diff(time)]
producing:
time =
1
5
15
dtime =
0
4
10
2 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Creating and Concatenating Matrices finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!