Create Matrix Please Help Me
Ältere Kommentare anzeigen
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.

Antworten (1)
This is one way
n = 6;
A = diag(1:n)
[bx by] = meshgrid(n:-1:1);
B = triu(by) + tril(bx,-1)
Kategorien
Mehr zu Creating and Concatenating Matrices finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!