Question
2. (# Points) Write MATLAB code to prompt a user for the size of a square array. Since the array is square the number of
2. (# Points) Write MATLAB code to prompt a user for the size of a square array. Since the array is square the number of rows will equal the number of columns. Your code will then fill in the upper triangle of the matrix using a for loop structure you design that can, but does not have to, contain logic blocks. The data filled into the array will be counting integers, and only in the upper triangle of the array. Examples of a 3x3 and a 5x5 are provided below. Again, your code will prompt the user for the size and adapt to the size entered. Example 3x3 array
1 2 3
0 4 5
0 0 6
Example 5x5 array
1 2 3 4 5
0 6 7 8 9
0 0 10 11 12
0 0 0 13 14
0 0 0 0 15
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started