Mercurial > hg > octave-lyh
annotate scripts/miscellaneous/delete.m @ 11523:fd0a3ac60b0e
update copyright notices
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Fri, 14 Jan 2011 05:47:45 -0500 |
parents | 1740012184f9 |
children | 9a8763bcf575 |
rev | line source |
---|---|
11523 | 1 ## Copyright (C) 2004-2011 John W. Eaton |
4691 | 2 ## |
3 ## This file is part of Octave. | |
4 ## | |
5 ## Octave is free software; you can redistribute it and/or modify it | |
6 ## under the terms of the GNU General Public License as published by | |
7016 | 7 ## the Free Software Foundation; either version 3 of the License, or (at |
8 ## your option) any later version. | |
4691 | 9 ## |
10 ## Octave is distributed in the hope that it will be useful, but | |
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
13 ## General Public License for more details. | |
14 ## | |
15 ## You should have received a copy of the GNU General Public License | |
7016 | 16 ## along with Octave; see the file COPYING. If not, see |
17 ## <http://www.gnu.org/licenses/>. | |
4691 | 18 |
19 ## -*- texinfo -*- | |
9316
c539ec5726e7
Update some of Advanced Plotting documentation.
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
20 ## @deftypefn {Function File} {} delete (@var{file}) |
c539ec5726e7
Update some of Advanced Plotting documentation.
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
21 ## @deftypefnx {Function File} {} delete (@var{handle}) |
8188
946035db5605
delete.m: Permit a vector of handles to be deleted.
Ben Abbott <bpabbott@mac.com>
parents:
7017
diff
changeset
|
22 ## Delete the named file or graphics handle. |
9316
c539ec5726e7
Update some of Advanced Plotting documentation.
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
23 ## |
c539ec5726e7
Update some of Advanced Plotting documentation.
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
24 ## Deleting graphics objects is the proper way to remove |
c539ec5726e7
Update some of Advanced Plotting documentation.
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
25 ## features from a plot without clearing the entire figure. |
c539ec5726e7
Update some of Advanced Plotting documentation.
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
26 ## @seealso{clf, cla} |
4691 | 27 ## @end deftypefn |
28 | |
29 ## Author: jwe | |
30 | |
6257 | 31 function delete (arg) |
4691 | 32 |
33 if (nargin == 1) | |
6257 | 34 if (ischar (arg)) |
8438 | 35 files = glob (arg).'; |
36 if (isempty (files)) | |
37 warning ("delete: no such file: %s", arg); | |
38 endif | |
39 for i = 1:length (files) | |
40 file = files{i}; | |
41 [err, msg] = unlink (file); | |
42 if (err) | |
43 warning ("delete: %s: %s", file, msg); | |
44 endif | |
45 endfor | |
8197
4c85b8056d0b
delete.m: pass array of handles to __go_delete__
John W. Eaton <jwe@octave.org>
parents:
8188
diff
changeset
|
46 elseif (all (ishandle (arg(:)))) |
6405 | 47 ## Delete a graphics object. |
8197
4c85b8056d0b
delete.m: pass array of handles to __go_delete__
John W. Eaton <jwe@octave.org>
parents:
8188
diff
changeset
|
48 __go_delete__ (arg); |
6257 | 49 else |
11472
1740012184f9
Use uppercase for variable names in error() strings to match Info documentation. Only m-files done.
Rik <octave@nomad.inbox5.com>
parents:
9316
diff
changeset
|
50 error ("delete: first argument must be a filename or graphics handle"); |
6257 | 51 endif |
4691 | 52 else |
6046 | 53 print_usage (); |
4691 | 54 endif |
55 | |
56 endfunction |