Calling python script from another python script in MATLAB

1 view (last 30 days)
Kumar Gaurav
Kumar Gaurav on 29 Sep 2021
Commented: Sean de Wolski on 3 Oct 2021
I am trying to run a script in MATLAB. has another function in it named as mymul(x) (stored in script mymul_test) which takes input x and gives the square output. has the following functions
# -*- coding: utf-8 -*-
Created on Thu Sep 23 12:29:23 2021
@author: kumarg
from mymul_test import mymul
def myfunct_test(words):
mymul(2) has following
def mymul(y):
p = y*y
When I run
cal = py.mymul_test.mymul(2)
cal =
but when i run
>> cal = py.test.mymul(2)
Undefined variable "py" or class "py.test.mymul".
>> cal=py.test.mymul;
Undefined variable "py" or class "py.test.mymul".
Where I am doing wrong?




Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!