Scalar Matrix Manipulation - MATLAB Cody - MATLAB Central

Problem 44821. Scalar Matrix Manipulation

Difficulty:Rate

Assume, input x is a scalar matrix such as,

x =
       2     0     0
       0     2     0
       0     0     2

then the output matrix will be,

y =
       0     2     2
       2     0     2
       2     2     0

Solution Stats

70.27% Correct | 29.73% Incorrect
Last Solution submitted on May 14, 2025

Problem Comments

Solution Comments

Show comments
Why should you share code?
In a discussion on LInkedin about my recent blog post, Do these...
3
6

Problem Recent Solvers48

Suggested Problems

More from this Author1

Community Treasure Hunt

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

Start Hunting!