Problem 42710. Cleaner

Write a code cleaner which creates variable/object that can clear current workspace when used. Missing semicolon (";") in line returning that "thing" will activate cleaning. Example:

   >> x = 1; y = 2; z = 3;
   >> a = cleaner;
   >> b = a;
   >> who
   Your variables are:
   a  b  x  y  z  
   >> b
   >> who
   Your variables are:
   b
   >> c = b
   >> who
   Your variables are:
   c
   >> z = 7
   z = 
       7
   >> cleaner
   >> who
   Your variables are:
   ans

Solution Stats

15.58% Correct | 84.42% Incorrect
Last Solution submitted on May 24, 2021

Problem Comments

Solution Comments

Show comments

Problem Recent Solvers7

Suggested Problems

More from this Author40

Problem Tags

Community Treasure Hunt

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

Start Hunting!