Make Sequence Function go Diagonal
이전 댓글 표시
Hi ,how would i make this function go diagonal?,any help would be great
n = input ('sequence_matrix_');
fibb=[1,3:n];
for i=3:n
fibb(i)=fibb(i-1)*3+(i)-2;
end
fibb
댓글 수: 2
Sam Chak
2023년 11월 23일
The original question may be beneficial for people who wish to learn how to create a diagonal matrix.

Rena Berman
2023년 11월 27일
(Answers Dev) Restored edit
채택된 답변
추가 답변 (1개)
Walter Roberson
2021년 7월 19일
n = input ('sequence_matrix_');
fibb = diag([1,3:n]);
for i=3:n
fibb(i,i) = fibb(i-1,i-1)*3+(i)-2;
end
fibb
카테고리
도움말 센터 및 File Exchange에서 Programming에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!