Problem 45276. No of squares in a grid
given a m*n grid
calculate the no of possible squares & rectangles on that grid.
output: y=[no of rectangles , no of sqaures]
Solution Stats
Problem Comments
- 
		2 Comments
		Dyuman Joshi
    	on 24 Dec 2020
	
	
  	Just wondering, how can a 1x1 grid have any rectangles or square?
		Christian Schröder
    	on 28 Feb 2023
	
	
  	Just wondering about the same thing --- I think what's meant here is that you've got a grid of MxN squares, i.e. of (M+1)x(N+1) points, rather than MxN points.
Solution Comments
Show commentsProblem Recent Solvers20
Suggested Problems
- 
         Find the peak 3n+1 sequence value 2542 Solvers 
- 
         Find the elements of a matrix according to a defined property. 90 Solvers 
- 
         Rotate input square matrix 90 degrees CCW without rot90 659 Solvers 
- 
         Determine if input is a Narcissistic number 204 Solvers 
- 
         
         254 Solvers 
More from this Author174
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!