Borrar filtros
Borrar filtros

diff operation generating error Subscript indices must either be real positive integers or logicals

1 visualización (últimos 30 días)
I have a time vector which I have attached in a .mat file.
diff(time) generates the following error: Subscript indices must either be real positive integers or logicals.
time is a vector, it does not contain values to be interpreted as indices. Why is this occurring & how can I correct it?

Respuesta aceptada

Matt J
Matt J el 16 de Feb. de 2017
Editada: Matt J el 16 de Feb. de 2017
You have a variable named "diff" somewhere in your workspace. MATLAB is interpreting diff(time) as an attempt to index it.
Solution: clear it or rename it to something else.

Más respuestas (0)

Categorías

Más información sobre Matrices and Arrays en Help Center y File Exchange.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by