Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我注意到您可以在 matlab 中使用以下两个代码创建一个矩阵...
m=[1:2:10]
或者
m=1:2:10
上述两者之间实际上有什么区别吗?他们似乎输出相同的东西?
谢谢
没有区别,方括号可用于连接,例如:
m = [1:2:10 50]
结果是:
m = 1 3 5 7 9 50
对于您的问题中使用的数组,无需这样做。