How to create a matrix where the value shifts to the write with each row? And how do I create a vector that increases and then decreases?
10 次查看(过去 30 天)
显示 更早的评论
I need to make a square matrix that is 583x583. With every row, the values shift to the right and the values shift to the right are zeros. In other words, the matrix needs to be shaped like this:
F= [ F(1) 0 0......0
[ F(2) F(1) 0 0 .....0
[F(583) F(582)........F(1)]
The issue that I'm also having is creating the values for F. The values are based on a graph that increases and then decreases. So it has to be:
F=[10E-1 10 10E-1 10E-2 9E-3 8E-3 7E-3 6E-3........]. How do I create a for loop that will decrease the values like that?
0 个评论
回答(1 个)
Matt J
2021-11-3
F=[10E-1 10 10E-1 10E-2 , (9:-1:1)*1e-3];
toeplitz(F,[F(1), zeros(1,numel(F)-1 )])
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!