Info
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
A question about generating a matrix
조회 수: 1 (최근 30일)
이전 댓글 표시
If I want to have a matirx which follows the change of n, says when n=2, A=[0 1] when n=3,A=[0 0 1], n=5, A=[0 0 0 0 1]. How can I achieve this goal using code? Thank you.
댓글 수: 0
답변 (1개)
Bruno Luong
2018년 10월 11일
clear A
A(n) = 1
댓글 수: 2
Bruno Luong
2018년 10월 11일
편집: Bruno Luong
2018년 10월 11일
Presumably you want "0" and not "o", add the following
A=A(:)
or
clear A
A(n,1) = 1
이 질문은 마감되었습니다.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!