# Informatics1-2019/HW6

(Változatok közti eltérés)
Gaebor
(Új oldal, tartalma: „= MatLab = 6 points The task is to write two matlab functions, each in one <tt>.m</tt> file. You have to attack these files to your email. The name of the files should…”)
Újabb szerkesztés →

# 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 be 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