将 Python dict 转换为等效的 Octave
Converting a Python dict to Octave equivalent
Python中dict
的定义是什么?
Octave 或 MATLAB 中的等效项是什么,如果它们之间存在差异?
Python:
return dict(Fx = fxp, Fy = fyp, MO = MOp)
如有任何建议,我将不胜感激。
在python中dict
是一个associative array。 Octave 中没有直接等效项。
更新:Florian 建议 matlab 结构可以提供类似的功能。
You could "emulate" the associative nature of Pythons dictionaries with Matlabs structs, since Pythons d["key"] = value is not too different from Matlabs s.('key') = value; But certainly, it is not the same and not as efficient
Python中dict
的定义是什么?
Octave 或 MATLAB 中的等效项是什么,如果它们之间存在差异?
Python:
return dict(Fx = fxp, Fy = fyp, MO = MOp)
如有任何建议,我将不胜感激。
在python中dict
是一个associative array。 Octave 中没有直接等效项。
更新:Florian 建议 matlab 结构可以提供类似的功能。
You could "emulate" the associative nature of Pythons dictionaries with Matlabs structs, since Pythons d["key"] = value is not too different from Matlabs s.('key') = value; But certainly, it is not the same and not as efficient