How to find maximum square zero matrix through the biggest matrix?
Show older comments
how to plot a picture in matlab?
Below is the code that generates a random 6*6 diagonal square matrix.
And, the resulting random matrix (Mout) is here.

For example, the largest square zero matrix for this matrix is as follows.
4*4 Square zero matrix for the 6*6 square matrix.So, how can I find the size of the maximum square zero matrix that can be created from this matrix?
7 Comments
Matt J
on 18 Jun 2021
We can't copy/paste your code (because it's an image).
John D'Errico
on 18 Jun 2021
Note that it is easier to paste in text code, than it is to insert a picture of code. In order help you, we need to re-type your code, from a picture. Why would you go out of your way to ask a question in a more difficult way, to then make it more difficult to get help?
Serafettin Bal
on 18 Jun 2021
Jan
on 18 Jun 2021
How large is the input? Would a brute force method satisfy your needs? The rolling on the boarders is hard. Otherwise this would be useful: https://www.mathworks.com/matlabcentral/answers/24943-detect-square-in-image
Atsushi Ueno
on 18 Jun 2021
Edited: Atsushi Ueno
on 18 Jun 2021
The question is "almost" same as this cody problem below. I have not solved yet.
(added) I have found the difference between your question and this problem, you would like to find the largest square that can wrap across the edges like "Karnaugh map".
I recovered the removed content from the Google cache (something which anyone can do). Editing away your question is very rude. Someone spent time reading your question, understanding your issue, figuring out the solution, and writing an answer. Now you repay that kindness by ensuring that the next person with a similar question can't benefit from this answer.
The image of the code was later replaced by this:
N = randi([6 6],1);
M = randi([0 1], N);
Mu = triu(M);
Ml = Mu';
Mout = Mu + Ml;
Mout = Mout - diag(diag(Mout));
G = graph(Mout,'lower');
plot(G)
Atsushi Ueno
on 22 Jun 2021
@Rik Thank you for your recovering action. I can read back the comment left by the questioner in the history, so I will answer it.
Accepted Answer
More Answers (0)
Categories
Find more on Get Started with Curve Fitting Toolbox in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!