Create Matrix Please Help Me
이전 댓글 표시
Hello please help me I need a answer this question.
Write separately the following patterns (a), (b) the MATLAB program codes that can be created for any N value entered by the user, given as an example for the n= 6 value.

답변 (1개)
This is one way
n = 6;
A = diag(1:n)
[bx by] = meshgrid(n:-1:1);
B = triu(by) + tril(bx,-1)
카테고리
도움말 센터 및 File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!