How can I use matlab table (array with named variables) in octave

The table data type in MATLAB is not yet implemented in Octave. There is a table function in Octave for creating a contingency table, which is what your code is using, and is obviously not what you want.

As an alternative, you may want to check out the Dataframe package, which can provide you with similar functionality to a MATLAB table.