Informatics1-2019/HW6

A MathWikiből
A lap korábbi változatát látod, amilyen Gaebor (vitalap | szerkesztései) 2019. december 2., 22:21-kor történt szerkesztése után volt.

Tartalomjegyzék

MatLab

6 points

The task is to write two matlab functions, each in one .m file. You have to attack these files to your email. The name of the files should be the same as the functions.

Magic Matrix (3 points)

Write a magicmatrix function that has two arguments: two positive integers n and m. The result should be a n\times m matrix with 0 and 1 values of a pattern where two ones are next to each other and the pattern goes diagonally up and right (two to the right, one upwards). This pattern should begin at every third line.

Example:

>> magicmatrix(12,10)
  1   1   0   0   0   0   1   1   0   0   0
  0   0   0   0   1   1   0   0   0   0   1
  0   0   1   1   0   0   0   0   1   1   0
  1   1   0   0   0   0   1   1   0   0   0
  0   0   0   0   1   1   0   0   0   0   1
  0   0   1   1   0   0   0   0   1   1   0
  1   1   0   0   0   0   1   1   0   0   0
  0   0   0   0   1   1   0   0   0   0   1
  0   0   1   1   0   0   0   0   1   1   0
  1   1   0   0   0   0   1   1   0   0   0
  0   0   0   0   1   1   0   0   0   0   1
  0   0   1   1   0   0   0   0   1   1   0

Elimination (3 points)

Deadline

2019 December 8th, 23:59

Személyes eszközök