cross in array - MATLAB Cody - MATLAB Central

Problem 43125. cross in array

Difficulty:Rate

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

70.07% Correct | 29.93% Incorrect
Last Solution submitted on Apr 22, 2025

Problem Comments

Solution Comments

Show comments
Registration Now Open for MathWorks AUTOMOTIVE CONFERENCE 2025
...
Hello Community, We're excited to announce that registration is now open for the...

Problem Recent Solvers179

Suggested Problems

More from this Author12

Problem Tags

Community Treasure Hunt

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

Start Hunting!
Go to top of page