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.
考虑向量 a=[a_1 , a_2 ,.. a_n] 并用 a^q 表示每个元素都被提升到 q 次方的向量。那么创建例如 A=[a^1 的最简单方法是什么?一^2; 一个^3]?
您可以使用bsxfun单例扩展来帮助解决这个问题
bsxfun
bsxfun(@power, a, [1:3]')