Matlab (deprecated)

Similar to the Table function selector, F(x) Table, one can with this node apply non-general functions/scripts to the content of Tables. The difference is that the considered node uses Matlab as scripting engine instead of Python. Another difference is that the Python file coming in to the function selector includes one or many selectable functions, which is not the case for this node. Here, the Matlab file only consists of a single written script.

In the matlab script one reaches the columns in the Table with the hdfread command, like

name_of_column_in_matlab = hdfread(infilename, '/name_of_column_in_Table');

and return the achieved results with hdfwrite

hdfwrite(outfilename, 'Name_of_result', result_variable);

Do not change infilename and outfilename in the calls to hdfread and hdfwrite, these are the names of variables transfered to Matlab from Sympathy for Data. If several results are transmitted to the outgoing Table, keep in mind that the length of the result arrays have the same length.

Here follows an example of a small script that can be applied the data in cardata.csv, located in the Examples folder in the Sympathy for Data directory,

price = hdf5read(infilename, '/price');

hdf5write(outfilename, 'MAX_PRICE', max(price), 'MIN_PRICE', min(price));
class node_matlab_old.Matlab[source]

Run Matlab code in Sympathy.

: Table

Table with data that is needed in the Matlab script.

: Table

Table with the results from Matlab stored in separate columns.

Opposite node:
Ref. nodes:

F(x) Table