Find which command used
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
What matlab command, or combination of commands (using 25 characters or less), could be used to create the following matrix?
1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0
1 1 0 0 0 1 1 0 0 0 1 1 0 0 0 1 1 0 0 0
1 1 1 0 0 1 1 1 0 0 1 1 1 0 0 1 1 1 0 0
1 1 1 1 0 1 1 1 1 0 1 1 1 1 0 1 1 1 1 0
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0
1 1 0 0 0 1 1 0 0 0 1 1 0 0 0 1 1 0 0 0
1 1 1 0 0 1 1 1 0 0 1 1 1 0 0 1 1 1 0 0
1 1 1 1 0 1 1 1 1 0 1 1 1 1 0 1 1 1 1 0
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0
1 1 0 0 0 1 1 0 0 0 1 1 0 0 0 1 1 0 0 0
1 1 1 0 0 1 1 1 0 0 1 1 1 0 0 1 1 1 0 0
1 1 1 1 0 1 1 1 1 0 1 1 1 1 0 1 1 1 1 0
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0
1 1 0 0 0 1 1 0 0 0 1 1 0 0 0 1 1 0 0 0
1 1 1 0 0 1 1 1 0 0 1 1 1 0 0 1 1 1 0 0
1 1 1 1 0 1 1 1 1 0 1 1 1 1 0 1 1 1 1 0
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0
1 1 0 0 0 1 1 0 0 0 1 1 0 0 0 1 1 0 0 0
1 1 1 0 0 1 1 1 0 0 1 1 1 0 0 1 1 1 0 0
1 1 1 1 0 1 1 1 1 0 1 1 1 1 0 1 1 1 1 0
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
Hint: Look for a lower triangluar matrix that is repeated many times. First try to produce that lower triangular matrix with as few characters as possible.
8 Kommentare
Jan
am 6 Mär. 2015
I miss Matt Figs the hump-day puzzlers. The assessment method of Cody collide with my personal opinion about nice and efficient code.
Adam
am 6 Mär. 2015
Yes, I never go near Cody personally since I found that 'best' solutions to many problems involve some ridiculous use of regexp. Personally my idea of good code doesn't involve using the fewest characters possible!
Antworten (1)
Star Strider
am 3 Mär. 2015
This looks like a homework assignment, so I’ll direct you to three functions: ones, tril, and repmat.
2 Kommentare
Siehe auch
Kategorien
Mehr zu Logical finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!