Create a loop for this matrix
이전 댓글 표시
1 -1 0 0 0 ...
-1 2 -1 0 0 ...
0 -1 2 -1 0 ...
0 0 -1 2 -1 ...
0 0 0 -1 2 ...
As you can see, this can go on forever, I and would like to find a way to write loop for a dynamic matrix where this just keeps going unitl a certain number 'N'
댓글 수: 4
dpb
2021년 6월 4일
What's the RH end condition definition?
Rayden Plasma
2021년 6월 4일
David Fletcher
2021년 6월 4일
편집: David Fletcher
2021년 6월 4일
I think they are asking what the end of the final row should be - I would guess [zeros(N-2,1) -1 1]
Rayden Plasma
2021년 6월 4일
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!