Find which command used

1 Ansicht (letzte 30 Tage)
you wu
you wu am 3 Mär. 2015
Kommentiert: Adam am 6 Mär. 2015
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
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
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!

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Star Strider
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
you wu
you wu am 5 Mär. 2015
sorry,not
Star Strider
Star Strider am 5 Mär. 2015
I’m lost. What do you mean?

Melden Sie sich an, um zu kommentieren.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by