Problem 43125. cross in array

Created by Jakub Mrowka in Community

Make a cross from "1" in odd size array. Other value from array should be equal to "0"; As input you get length of side of array; x=3;

y=[ 0 1 0; 
    1 1 1;
    0 1 0];

please pay attention input will be always odd nubmer greater than 1;

Solution Stats

65.03% Correct | 34.97% Incorrect
Last solution submitted on Mar 12, 2019

Problem Comments

Recent Solvers88

Suggested Problems

More from this Author12

Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!