I downloaded mlabwrap-purepy from: https://github.com/cpbotha/mlabwrap-purepy
Next, I call matlab functions using the following:
%% Python init <br>
import matlabwrap <br>
mlab = matlabwrap.init() <br>
%% <br>
I can easily call all inbuilt matlab functions, but while calling custom functions I run into Type-Error. Consider the following matlab function:
%% Matlab Function %% <br>
function [x] = get_x() <br>
x = 1; <br>
end <br>
%%% <br>
when I run, mlab.get_x()
I get the following error:
TypeError: cannot concatenate 'str' and 'numpy.ndarray' objects <br>
Any clues to what might be happening?
I looked at: Run a MATLAB script from python + pass args - but it didn't resolve my issue.
However, when I run simple matlab scripts using mlab.eval with no input args it works, such as:
x = mlab.eval('get_x') <br>
I would like to be able to run like - mlab.function_name(arg1,arg2)
- but I hit the error as described above. Any clues to what might fix this?