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

5 Ansichten (letzte 30 Tage)
anand singh
anand singh am 7 Sep. 2019
Kommentiert: anand singh am 7 Sep. 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.

Akzeptierte Antwort

Guillaume
Guillaume am 7 Sep. 2019
Bearbeitet: Guillaume am 7 Sep. 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)

Weitere Antworten (0)

Kategorien

Mehr zu Tables 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!

Translated by