How to select a sub square matrix, from a matrix; given the size of the sub square matrix and middle element
Show older comments
M = [
82 10 16 15 66 76
91 28 98 43 4 75
13 55 96 92 85 40
92 96 49 80 94 66
64 97 81 96 68 18 ]
i need sub sqaure matrices, given size ofthe sub matrix and middle element.
4 Comments
Walter Roberson
on 9 Aug 2020
Do you mean you are given the value of the middle element, and you have to find it in the matrix and use that as the centre of the submatrix to extract? If so then what result should there before for value 96, which occurs three times in the array?
MANOGNA POTLURI
on 9 Aug 2020
Walter Roberson
on 9 Aug 2020
You did not really answer the question though. Is the requirement to locate the center of the matrix according to a given value? Or would you instead be given a position ?
MANOGNA POTLURI
on 9 Aug 2020
Accepted Answer
More Answers (0)
Categories
Find more on Matrix Indexing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!