Vpython 中的 Matlab 冒号运算符等效项
在花了过去几个月学习 MATLAB 后,看来我需要切换到 vpython! MATLAB 的冒号运算符经常派上用场,但我在 vpython 中还没有找到等效的运算符。
作为参考,在 MATLAB 中:
-3:3 = [-3, -2, -1, 0, 1, 2, 3]
有没有简单的方法可以在 vPython 中做同样的事情?
After spending the last few months learning about MATLAB, it seems I need to switch to vpython! MATLAB's colon operator comes in handy often and I haven't found an equivalent in vpython.
For reference, in MATLAB:
-3:3 = [-3, -2, -1, 0, 1, 2, 3]
Is there any easy way to do the same thing in vPython?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我不知道 vpython,但在仔细阅读其 教程 后,我猜想它与 Python 中相同:
I don't know vpython, but after perusing its tutorial, I would guess it is the same as in Python:
如果您使用 numpy,则可以使用 numpy.r_ :
If you use numpy, you can use numpy.r_ :