【发布时间】:2017-10-06 00:26:32
【问题描述】:
是否可以在 MATLAB 中定义类似于 Python 中的“call”方法的类方法?
您将如何在 MATLAB 中实现以下 Python 类。
class Basic(object):
def __init__(self, basic):
self.basic = basic
def __call__(self, x, y):
return (numpy.sin(y) *numpy.cos(x))
def _calc(self, y, z):
x = numpy.linspace(0, numpy.pi/2, 90)
basic = self(x, y)
return x[tuple(basic< b).index(False)]
【问题讨论】:
标签: python matlab class object call