Hi guys, I'm taking an engineering class and i'm not familiar with Matlab at all. I've been trying to generate a square matrix from an input with a pattern.

For example:

1 0

0 1

1 0 1

0 1 0

1 0 1

1 0 1 0

0 1 0 1

1 0 1 0

0 1 0 1

I started with a = input('enter the size')

I tried making all zeros and then trying to modify the odds or make all 1's and try to replace some of them with 0s. Could someone point me towards the function or commands i should use? thank you very much!