Undefined function 'diff' for input arguments of type 'table'

5 visualizaciones (últimos 30 días)
anand singh
anand singh el 7 de Sept. de 2019
Comentada: anand singh el 7 de Sept. de 2019
Dear Members,
I am facing following error when running my MATLAB code. Please advice the solution for this.
>> ind1=find( diff(daily_stk(:,2)) ~= 0 ); % row number
Undefined function 'diff' for input arguments of type 'table'.
daily_stk.Properties
ans =
TableProperties with properties:
Description : ''
UserData : []
DimensionNames : {'Row' 'Variables'}
VariableNames : {'yyyy' 'mm' 'dd' 'vwretd'}
VariableDescriptions : {}
VariableUnits : {}
VariableContinuity : []
RowNames : {}
CustomProperties : No custom properties are set.
Use addprop and rmprop to modify CustomProperties.

Respuesta aceptada

Guillaume
Guillaume el 7 de Sept. de 2019
Editada: Guillaume el 7 de Sept. de 2019
As I've told you already, read the documentation, in particular Access data in tables.
As explained on that page, () indexing returns a table. You want the content of the table which you can access with
daily_stk{:, 2}
or
daily_stk.(2)
or better
daily_stk.mm
so,
rowindex = find(diff(daily_stk.mm) ~= 0)

Más respuestas (0)

Categorías

Más información sobre Tables en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by