replace empty matrices with '[]' - MATLAB Cody - MATLAB Central

Problem 42500. replace empty matrices with '[]'

Difficulty:Rate

for example

a=1;a(:,1)=[]; returns 
a =
   Empty matrix: 1-by-0
use this as the input,and the output should be '[]'

require no appearance of '[]' and 'empty' method inside the function

Solution Stats

47.2% Correct | 52.8% Incorrect
Last Solution submitted on Jun 15, 2025

Problem Comments

Solution Comments

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

Problem Recent Solvers54

Suggested Problems

More from this Author1

Problem Tags

Community Treasure Hunt

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

Start Hunting!