clear - Remove objects from MATLAB® workspace

Syntax

clear obj

Arguments

obj

An object or an array of objects.

Description

clear obj removes obj from the MATLAB workspace.

Remarks

If obj references an object in the job manager, it is cleared from the workspace, but it remains in the job manager. You can restore obj to the workspace with the findResource, findJob, or findTask function; or with the Jobs or Tasks property.

Examples

This example creates two job objects on the job manager jm. The variables for these job objects in the MATLAB workspace are job1 and job2. job1 is copied to a new variable, job1copy; then job1 and job2 are cleared from the MATLAB workspace. The job objects are then restored to the workspace from the job object's Jobs property as j1 and j2, and the first job in the job manager is shown to be identical to job1copy, while the second job is not.

job1 = createJob(jm);
job2 = createJob(jm);
job1copy = job1;
clear job1 job2;
j1 = jm.Jobs(1);
j2 = jm.Jobs(2);
isequal (job1copy, j1)
ans =
     1
isequal (job1copy, j2)
ans =
     0

See Also

createJob, createTask, findJob, findResource, findTask

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS