Problem 43492. Create a square matrix with given conditions
Create a square matrix, M, which should be populated as follows:
 M = [ n^2      n * (n-1)    n * (n-2)  ...    n * 2    n * 1;
     (n-1)*n  (n-1)*(n-1)  (n-1)*(n-2)  ...  (n-1)*2  (n-1)*1;
     (n-2)*n  (n-2)*(n-1)  (n-2)*(n-2)  ...  (n-2)*2  (n-2)*1;
        .          .            .       .       .       .    ;
        .          .            .        .      .       .    ;
        .          .            .         .     .       .    ;
       2 * n    2 * (n-1)    2 * (n-2)  ...    2 * 2    2 * 1;
       1 * n    1 * (n-1)    1 * (n-2)  ...    1 * 2    1 * 1]
			Solution Stats
Problem Comments
- 
		2 Comments
 
		Olha Remesh
    	on 30 Oct 2016
	
	
  	6775745764
		goc3
    	on 29 Nov 2016
	
	
  	The problem description and test suite have been improved.
Solution Comments
Show commentsProblem Recent Solvers120
Suggested Problems
- 
         
         
29334 Solvers
 - 
         
Project Euler: Problem 7, Nth prime
1609 Solvers
 - 
         
Calculate the Number of Sign Changes in a Row Vector (No Element Is Zero)
840 Solvers
 - 
         
Matlab Basics II - Count rows in a matrix
394 Solvers
 - 
         
Create sequnce 1 4 9 16 25.........
409 Solvers
 
More from this Author37
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!