Create Matrix Please Help Me
Mostrar comentarios más antiguos
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.

Respuestas (1)
This is one way
n = 6;
A = diag(1:n)
[bx by] = meshgrid(n:-1:1);
B = triu(by) + tril(bx,-1)
Categorías
Más información sobre Creating and Concatenating Matrices en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!