Matlab in KNIME

Hi all,
I´m currently trying to get the nodes Matlab snipped and Matlab Plot to work. But both cause problem. By Matlab snipped I can’t get an output even if my code just consist of

s.a = 1;
s.b = {‘A’,‘B’,‘C’};

mOut = s;

If I run this code the output consist simply of 2 columes named a and b but both are empty.
I also tried different datatypes like dataset and table but both have the same problem as above.
I also tried mOut=kIn, which works and I get my input as output.

The second problem I have is with Matlab Plot, which returns always the error message:

Error using num2str
Too many input arguments.

in Matlab itself. There my code only consists of
plot(1:10,1:10).

Does anybody has an idea how to fix this?

Best

Jan

Hi Jan,

sorry for the late reply. Our developer is on vacation and we dont use Matlab anymore.

I still hope I can help you a bit although I dont know Matlab. Have a look here:
KNIME Scripting Integration Wiki
There you will find URLs of templates (in RGG), where some Matlab code is embedded. You can also configure KNIME pref to use those links as templates. These should run, otherwise you have a problem with the KNIME / Matlab connection, but since you said mOut=kIn works this looks good.

I assume that mOut in the snippet must be a special format like a dataset. Otherwise KNIME does not know how to handle it.
For the plot I have no idea, please look into the templates as an example…

Hope that helps, have a nice weekend,

Martin

2 Likes

Hi Martin,
thanks for the answere. I was able to sort of solve the problem.
You have to use the datatype table, which also tried it before but there I declared the variable via table(x,y,…).
Instead you have to transform an array into a table via array2table.
I´m not to sure why this works.
Best

Jan

1 Like