【发布时间】:2016-12-14 21:05:06
【问题描述】:
我有一个 python 代码,想用 Octave 编写一个相同的代码,但是有些命令我从未在 octave 中找到它们。有一部分代码我没看懂,就是这个函数:
def CVangles(theta, geo, key):
"""
Parameters
----------
theta : float
The crank angle, between 0 and 2*pi
geo : struct
The structure with the geometry obtained from get_geo()
key : string
The name of the involute to be considered
"""
CV = struct()
CV.Outer = struct()
CV.Inner = struct()
if key.startswith('c1.'):
alpha = int(key.split('.')[1])
CV.Outer.involute = INVOLUTE_FI
CV.Outer.phi_0 = geo.phi_fi0
return CV
如何在八度音阶中用startswith和split来表达
【问题讨论】:
标签: python python-2.7 octave