How can i remove loaded *.mat file from workspace?

20 views (last 30 days)
Can any one please tell me

Answers (1)

Raj
Raj on 5 Mar 2019
Use "clear all" command to clear your workspace. Be sure to save it first if you intend to reuse it again in future.
  3 Comments
Walter Roberson
Walter Roberson on 5 Mar 2019
Use clearvars unless you know exactly what clear all does.
But better is to assign the result of load() to a variable, which will return a structure with one field for each variable in the file. Access the appropriate structure field. Then to remove what was loaded, just clear the structure.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!