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.
我有一个 1 x 9 矩阵:
D = [6 5 2 9 8 4 3 1 7];
但我想将它从 1 - 9 重新编号为 4 - 12。所以最后,我会有这样的东西
D = [9 8 5 12 11 7 6 4 10]
有没有办法做到这一点?
谢谢,
只需将 3 添加到您的向量中:
D = [6 5 2 9 8 4 3 1 7]; E = D + 3;
这导致
E = 9 8 5 12 11 7 6 4 10