Error using diff(X) command
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Abdullah Abdullah
am 11 Jul. 2014
Kommentiert: kurt sundell
am 9 Mär. 2017
Hello all,
I am trying to store the difference of vector elements into an other vector. I have also seen the syntax using help command but still it persists.
Here is what I do
X = [1 1 2 3 5 8 13 21];
Y = diff(X)
the erorr is : Index exceeds matrix dimensions.
when I do difference of decimal numbers like
X = [0.001 0.001 0.002 0.003 0.005 0.008 0.0013 0.0021];
Y = diff(X)
Error says : "Subscript indices must either be real positive integers or logicals."
If diff(X) is only valid for integers, can some one suggest which alternative to use getting difference of adjacent decimal(floating point) elements of vector.
Regards Abdullah
0 Kommentare
Akzeptierte Antwort
Honglei Chen
am 11 Jul. 2014
Bearbeitet: Honglei Chen
am 11 Jul. 2014
You probably have a workspace variable named diff
2 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Logical 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!