Skip to content

Pass a python function to a matlab function? #89

@disadone

Description

@disadone

I am a little bit confused about how to use transplant.Matlab
I want to pass a python function and several other parameters to a matlab function, for example matlab.fminsearch. So I try

import transplant

matlab = transplant.Matlab()
def pyfunc(x):
    return x+1
func=transplant.MatlabFunction(matlab,pyfunc)

But func(1) returns

TypeError: can not serialize 'function' object

Many Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions