【发布时间】:2015-03-02 04:55:03
【问题描述】:
我对以下内容感到很困惑,
sqrt(1:3) * [1 2 3]
# 3x3 Matrix, as expected
sqrt(1:3) * 1:3
# error `colon` has no method matching...
直到我意识到 1:3 一定是另一种野兽,即不仅仅是我从 Matlab 中预期的向量。我目前的解决方法是使用hcat将其转换为向量,sqrt(1:3) * hcat(1:3...),有没有更好的方法?
【问题讨论】: