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?
조회 수: 5 (최근 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에서 Multidimensional Arrays에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!