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.
让给定的矩阵为:
c=[5.24 5.19 5.07 4.36; 5.39 5.44 5.38 5.32; 5.58 5.12 6.05 4.02]
我想计算输出矩阵,使得输出矩阵的第一行是c的第一行,然后输出矩阵的第二行是c的前两行的总和,第三行是c的三行的总和。如何为此编写matlab代码。
使用 Matlab 的累积和函数:
ans = cumsum(c);