How to use the Python script in Matlab to call the variables which defined in Matlab workspace? -


in matlab, variables can defined, example:

>>global x y >>x = 1; >>y = 2; 

then, try call variables x , y in pre-defined python scriptf()as:

def f():      global x y     return x + y 

however, when run python script in matlab:

>>py.f.f >>ans = >>        0 

it returns 0, expected value should 3.


Comments

Popular posts from this blog

matlab - error with cyclic autocorrelation function -

django - (fields.E300) Field defines a relation with model 'AbstractEmailUser' which is either not installed, or is abstract -

c# - What is a good .Net RefEdit control to use with ExcelDna? -