登录论坛

查看完整版本 : 我如何使用Matlab使用带有滞后的向量创建矩阵


poster
2019-12-10, 20:48
vector= 3 4 8 5 2 1 6 the matrix i want to create is 3 0 0 4 3 0 8 4 3 5 8 4 2 5 8 1 2 5 6 1 2

回答:

您先前的问题之一 (https://stackoverflow.com/questions/3345236/matrix-based-on-vector-and-diagonal-elements1-using-matlab)已经解决了这一问题 (https://stackoverflow.com/questions/3345236/matrix-based-on-vector-and-diagonal-elements1-using-matlab) 。尽管在此示例中您没有尝试创建方矩阵,但是仍然可以像Jonas的回答中 (https://stackoverflow.com/questions/3345236/matrix-based-on-vector-and-diagonal-elements1-using-matlab/3345287#3345287)一样使用TOEPLITZ (http://www.mathworks.com/access/helpdesk/help/techdoc/ref/toeplitz.html)函数:

M = toeplitz(vector,[vector(1) 0 0]);

更多&回答... (https://stackoverflow.com/questions/3357075)