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?
12 views (last 30 days)
Show older comments
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 Comments
Answers (1)
Matt J
on 3 Nov 2021
F=[10E-1 10 10E-1 10E-2 , (9:-1:1)*1e-3];
toeplitz(F,[F(1), zeros(1,numel(F)-1 )])
0 Comments
See Also
Categories
Find more on Logical in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!