Matlab Plot

This node executes a snippet/script using a local Matlab desktop instance to produce a plot (graph). The Matlab script can be coded manually or templates can be selected from a snippet template repository. Templates can be used as such or they can be modified to the users liking.

RGG (R GUI Generator) is used to configure the Matlab code using a graphical user interface in a way that the user does not need to know scripting in Matlab.

Script Editor:
Copy, cut or paste and Matlab code to the editor and/or select the columns from your data table. If a template is loaded used the GUI to adapt the script to the input data.

Templates:
Select a plot template from the template repository (double-click or "Use this template") to use that script and see the GUI. The description shows you an example plot than can be done using this template. Then configure the GUI according to your input data.

Output Options:
Specify the image dimensions of the plot and the type and location where to save that image.

This node needs a Matlab installation on the local machine!
If Matlab is not running, the node launches an instance of the Matlab desktop. It is recommended to let KNIME launch Matlab. The node can detect open Matlab instances, but this is not foolproof.

Conventions:

  • Snippet input variable name: kIn
  • Snippet output variable name: mOut
  • Supported Matlab types: dataset, table, struct or container.Map
  • While the script input type is defined by the preferences, the output type will be inferred from the output variable
  • The column names for dataset and table Matlab data types are taken from the object properties (VariableDescriptions/VarDesription). For the other types, they will be the same as the input as long as the header does not change.
  • Templates repositories are controlled via the preferences (Menu > KNIME > Preferences > KNIME > Matlab Scripting).

Further reading:
Further documentation can be found on the wiki.
To understand how to use flow variables in the script, please consult RGG XML.

Options

Script Editor/Unlink from Template
Gives access to the Matlab script after adaptation by the GUI.
Script Editor/Edit Template
Gives access to the RGG script.
Templates/Refresh
Loads again the template file.
Templates/Gallery
Generate a temporary webpage shown in a browser which gives an overview about all available templates.
Templates/Description,Source
Description shows some plot options and an example plot. Source displays the RGG script.
Templates/Use this template
Click to load the GUI (or double-click onto the template)
Output Options/File Type
Select .png or .jpeg
Output Options/Width, Height
Width and height of the plot in pixels, which is also used when the image is saved as a file.
Output Options/Selected File
Set the file name to save the plot as an image.
The following place-holders are supported: $$DATE$$ for the current date, $$USER$$ for the username, $$WS$$ for the workspace directory, and FLOWVAR(variablename) to use flow variable values in the file name.

Input Ports

Icon
A table which should be visualized with Matlab.

Output Ports

Icon
The generated Matlab plot as image column

Views

Matlab plot
The generated Matlab plot.

Workflows

  • No workflows found

Links

Developers

You want to see the source code for this node? Click the following button and we’ll use our super-powers to find it for you.