MATLAB: Operator ‘-‘ is not supported for operands of type ‘table’.

tabletabletoarray

dfdm,dm,

Best Answer

Assuming that data is your table, then you need to use the correct type of indexing:
  • () parenthese returns a sub-table of the table.
  • {} curly braces returns the contents of the table.
So you need to use curly braces if you want to use the numeric data stored in the table:
100 * 4 * ((data{2:end,4} - data{1:end-1,4} ) ./ data{1:end-1,4});
% ^ ^ ^ ^ ^ ^
The different types of indexing are explained in the MATLAB documentation: