From: <sch...@us...> - 2010-04-29 07:48:12
|
Revision: 7278 http://octave.svn.sourceforge.net/octave/?rev=7278&view=rev Author: schloegl Date: 2010-04-29 07:48:06 +0000 (Thu, 29 Apr 2010) Log Message: ----------- Oct2mat: move essential functions into directory basics, remove non-essential functions, replace deprecated functions Modified Paths: -------------- trunk/octave-forge/main/image/inst/corr2.m Added Paths: ----------- trunk/octave-forge/extra/oct2mat/inst/basics/ trunk/octave-forge/extra/oct2mat/inst/basics/arg.m trunk/octave-forge/extra/oct2mat/inst/basics/columns.m trunk/octave-forge/extra/oct2mat/inst/basics/file_in_loadpath.m trunk/octave-forge/extra/oct2mat/inst/basics/file_in_path.m trunk/octave-forge/extra/oct2mat/inst/basics/rindex.m trunk/octave-forge/extra/oct2mat/inst/basics/rows.m trunk/octave-forge/extra/oct2mat/inst/basics/substr.m trunk/octave-forge/extra/oct2mat/inst/basics/toascii.m trunk/octave-forge/extra/oct2mat/inst/basics/tolower.m trunk/octave-forge/extra/oct2mat/inst/basics/toupper.m trunk/octave-forge/extra/oct2mat/inst/startup.m Removed Paths: ------------- trunk/octave-forge/extra/oct2mat/inst/arg.m trunk/octave-forge/extra/oct2mat/inst/file_in_loadpath.m trunk/octave-forge/extra/oct2mat/inst/file_in_path.m trunk/octave-forge/extra/oct2mat/inst/is_matrix.m trunk/octave-forge/extra/oct2mat/inst/is_vector.m trunk/octave-forge/extra/oct2mat/inst/oneplot.m trunk/octave-forge/extra/oct2mat/inst/rindex.m trunk/octave-forge/extra/oct2mat/inst/striplegend.m trunk/octave-forge/extra/oct2mat/inst/substr.m trunk/octave-forge/extra/oct2mat/inst/toascii.m trunk/octave-forge/extra/oct2mat/inst/tolower.m trunk/octave-forge/extra/oct2mat/inst/toupper.m Deleted: trunk/octave-forge/extra/oct2mat/inst/arg.m =================================================================== --- trunk/octave-forge/extra/oct2mat/inst/arg.m 2010-04-28 21:46:29 UTC (rev 7277) +++ trunk/octave-forge/extra/oct2mat/inst/arg.m 2010-04-29 07:48:06 UTC (rev 7278) @@ -1,2 +0,0 @@ -function ph=arg(x) - ph=angle(x); Copied: trunk/octave-forge/extra/oct2mat/inst/basics/arg.m (from rev 7263, trunk/octave-forge/extra/oct2mat/inst/arg.m) =================================================================== --- trunk/octave-forge/extra/oct2mat/inst/basics/arg.m (rev 0) +++ trunk/octave-forge/extra/oct2mat/inst/basics/arg.m 2010-04-29 07:48:06 UTC (rev 7278) @@ -0,0 +1,2 @@ +function ph=arg(x) + ph=angle(x); Added: trunk/octave-forge/extra/oct2mat/inst/basics/columns.m =================================================================== --- trunk/octave-forge/extra/oct2mat/inst/basics/columns.m (rev 0) +++ trunk/octave-forge/extra/oct2mat/inst/basics/columns.m 2010-04-29 07:48:06 UTC (rev 7278) @@ -0,0 +1,26 @@ +function n = columns(x) +% COLUMNS returns number of columns. +% Columns is equivalent to size(x,2) +% +% nc = columns(x) +% +% see also: SIZE + +% This program is free software; you can redistribute it and/or +% modify it under the terms of the GNU General Public License +% as published by the Free Software Foundation; either version 3 +% of the License, or (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +% Copyright (C) 2008,2010 by Alois Schloegl <a.s...@ie...> +% This is part of the "Free Toolboxes for Matlab" (freetb4matlab) + +n = size(x,2); \ No newline at end of file Copied: trunk/octave-forge/extra/oct2mat/inst/basics/file_in_loadpath.m (from rev 7263, trunk/octave-forge/extra/oct2mat/inst/file_in_loadpath.m) =================================================================== --- trunk/octave-forge/extra/oct2mat/inst/basics/file_in_loadpath.m (rev 0) +++ trunk/octave-forge/extra/oct2mat/inst/basics/file_in_loadpath.m 2010-04-29 07:48:06 UTC (rev 7278) @@ -0,0 +1,3 @@ +function name=file_in_loadpath(file) + name=file_in_path(path,file); + \ No newline at end of file Copied: trunk/octave-forge/extra/oct2mat/inst/basics/file_in_path.m (from rev 7263, trunk/octave-forge/extra/oct2mat/inst/file_in_path.m) =================================================================== --- trunk/octave-forge/extra/oct2mat/inst/basics/file_in_path.m (rev 0) +++ trunk/octave-forge/extra/oct2mat/inst/basics/file_in_path.m 2010-04-29 07:48:06 UTC (rev 7278) @@ -0,0 +1,13 @@ +function name=file_in_path(p,file) + idx=[1 findstr(p,pathsep) length(p)+1]; + for i=1:length(idx)-1 + if idx(i+1)-idx(i)<=1, continue; end + dir=p(idx(i)+1:idx(i+1)-1); + name = fullfile(dir, file); + fid = fopen(name,"r"); + if fid >= 0, + fclose(fid); + return + end + end + name=[]; \ No newline at end of file Copied: trunk/octave-forge/extra/oct2mat/inst/basics/rindex.m (from rev 7263, trunk/octave-forge/extra/oct2mat/inst/rindex.m) =================================================================== --- trunk/octave-forge/extra/oct2mat/inst/basics/rindex.m (rev 0) +++ trunk/octave-forge/extra/oct2mat/inst/basics/rindex.m 2010-04-29 07:48:06 UTC (rev 7278) @@ -0,0 +1,7 @@ +function x=rindex(s,t) + idx = findstr(s,t); + if isempty(idx) + x = 0; + else + x = idx(length(idx)); + end Added: trunk/octave-forge/extra/oct2mat/inst/basics/rows.m =================================================================== --- trunk/octave-forge/extra/oct2mat/inst/basics/rows.m (rev 0) +++ trunk/octave-forge/extra/oct2mat/inst/basics/rows.m 2010-04-29 07:48:06 UTC (rev 7278) @@ -0,0 +1,27 @@ +function n = rows(x) +% ROWS returns number of rows of a matrix. +% Columns is equivalent to size(x,1) +% +% nr = rows(x) +% +% see also: SIZE + +% This program is free software; you can redistribute it and/or +% modify it under the terms of the GNU General Public License +% as published by the Free Software Foundation; either version 3 +% of the License, or (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +% Copyright (C) 2008,2010 by Alois Schloegl <a.s...@ie...> +% This is part of the "Free Toolboxes for Matlab" (freetb4matlab) + + +n = size(x,1); Copied: trunk/octave-forge/extra/oct2mat/inst/basics/substr.m (from rev 7263, trunk/octave-forge/extra/oct2mat/inst/substr.m) =================================================================== --- trunk/octave-forge/extra/oct2mat/inst/basics/substr.m (rev 0) +++ trunk/octave-forge/extra/oct2mat/inst/basics/substr.m 2010-04-29 07:48:06 UTC (rev 7278) @@ -0,0 +1,2 @@ +function y = substr(s, i, j) + y = s(i:i+j-1); Copied: trunk/octave-forge/extra/oct2mat/inst/basics/toascii.m (from rev 7263, trunk/octave-forge/extra/oct2mat/inst/toascii.m) =================================================================== --- trunk/octave-forge/extra/oct2mat/inst/basics/toascii.m (rev 0) +++ trunk/octave-forge/extra/oct2mat/inst/basics/toascii.m 2010-04-29 07:48:06 UTC (rev 7278) @@ -0,0 +1,4 @@ +function y=toascii(x) + if ischar(x), y=x; + else y=string(x); + end Copied: trunk/octave-forge/extra/oct2mat/inst/basics/tolower.m (from rev 7263, trunk/octave-forge/extra/oct2mat/inst/tolower.m) =================================================================== --- trunk/octave-forge/extra/oct2mat/inst/basics/tolower.m (rev 0) +++ trunk/octave-forge/extra/oct2mat/inst/basics/tolower.m 2010-04-29 07:48:06 UTC (rev 7278) @@ -0,0 +1,7 @@ +function retval = tolower (s) + + if (nargin != 1) + error ('t = tolower (s)'); + endif + + retval = lower (s); Copied: trunk/octave-forge/extra/oct2mat/inst/basics/toupper.m (from rev 7263, trunk/octave-forge/extra/oct2mat/inst/toupper.m) =================================================================== --- trunk/octave-forge/extra/oct2mat/inst/basics/toupper.m (rev 0) +++ trunk/octave-forge/extra/oct2mat/inst/basics/toupper.m 2010-04-29 07:48:06 UTC (rev 7278) @@ -0,0 +1,7 @@ +function retval = toupper (s) + + if (nargin != 1) + error ('t = toupper (s)'); + endif + + retval = upper (s); Deleted: trunk/octave-forge/extra/oct2mat/inst/file_in_loadpath.m =================================================================== --- trunk/octave-forge/extra/oct2mat/inst/file_in_loadpath.m 2010-04-28 21:46:29 UTC (rev 7277) +++ trunk/octave-forge/extra/oct2mat/inst/file_in_loadpath.m 2010-04-29 07:48:06 UTC (rev 7278) @@ -1,3 +0,0 @@ -function name=file_in_loadpath(file) - name=file_in_path(path,file); - \ No newline at end of file Deleted: trunk/octave-forge/extra/oct2mat/inst/file_in_path.m =================================================================== --- trunk/octave-forge/extra/oct2mat/inst/file_in_path.m 2010-04-28 21:46:29 UTC (rev 7277) +++ trunk/octave-forge/extra/oct2mat/inst/file_in_path.m 2010-04-29 07:48:06 UTC (rev 7278) @@ -1,13 +0,0 @@ -function name=file_in_path(p,file) - idx=[1 findstr(p,pathsep) length(p)+1]; - for i=1:length(idx)-1 - if idx(i+1)-idx(i)<=1, continue; end - dir=p(idx(i)+1:idx(i+1)-1); - name = fullfile(dir, file); - fid = fopen(name,"r"); - if fid >= 0, - fclose(fid); - return - end - end - name=[]; \ No newline at end of file Deleted: trunk/octave-forge/extra/oct2mat/inst/is_matrix.m =================================================================== --- trunk/octave-forge/extra/oct2mat/inst/is_matrix.m 2010-04-28 21:46:29 UTC (rev 7277) +++ trunk/octave-forge/extra/oct2mat/inst/is_matrix.m 2010-04-29 07:48:06 UTC (rev 7278) @@ -1,3 +0,0 @@ -function y=is_matrix(x) - y=isnumeric(x); - Deleted: trunk/octave-forge/extra/oct2mat/inst/is_vector.m =================================================================== --- trunk/octave-forge/extra/oct2mat/inst/is_vector.m 2010-04-28 21:46:29 UTC (rev 7277) +++ trunk/octave-forge/extra/oct2mat/inst/is_vector.m 2010-04-29 07:48:06 UTC (rev 7278) @@ -1,2 +0,0 @@ -function x=is_vector(y) - x=~isempty(y)&(all(size(y)==1)|sum(size(y)~=1)==1); \ No newline at end of file Deleted: trunk/octave-forge/extra/oct2mat/inst/oneplot.m =================================================================== --- trunk/octave-forge/extra/oct2mat/inst/oneplot.m 2010-04-28 21:46:29 UTC (rev 7277) +++ trunk/octave-forge/extra/oct2mat/inst/oneplot.m 2010-04-29 07:48:06 UTC (rev 7278) @@ -1,2 +0,0 @@ -function oneplot - set(gcf,'NextPlot','replace'); \ No newline at end of file Deleted: trunk/octave-forge/extra/oct2mat/inst/rindex.m =================================================================== --- trunk/octave-forge/extra/oct2mat/inst/rindex.m 2010-04-28 21:46:29 UTC (rev 7277) +++ trunk/octave-forge/extra/oct2mat/inst/rindex.m 2010-04-29 07:48:06 UTC (rev 7278) @@ -1,7 +0,0 @@ -function x=rindex(s,t) - idx = findstr(s,t); - if isempty(idx) - x = 0; - else - x = idx(length(idx)); - end Added: trunk/octave-forge/extra/oct2mat/inst/startup.m =================================================================== --- trunk/octave-forge/extra/oct2mat/inst/startup.m (rev 0) +++ trunk/octave-forge/extra/oct2mat/inst/startup.m 2010-04-29 07:48:06 UTC (rev 7278) @@ -0,0 +1,26 @@ + +% This program is free software; you can redistribute it and/or +% modify it under the terms of the GNU General Public License +% as published by the Free Software Foundation; either version 3 +% of the License, or (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; if not, write to the Free Software +% Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +% $Id$ +% Copyright (C) 2008,2010 by Alois Schloegl <a.s...@ie...> +% This is part of the "Free Toolboxes for Matlab" (freetb4matlab) +% suggested by Soren Hauberg Apr 2010 + +if (~exist (OCTAVE_VERSION),'builtin') + %% We are in Matlab + inst_dir = fileparts (mfilename ('fullpath')); + addpath (fullfile (inst_dir, 'basics')); + addpath (fullfile (fileparts(inst_dir), 'general'),'-end'); +end \ No newline at end of file Deleted: trunk/octave-forge/extra/oct2mat/inst/striplegend.m =================================================================== --- trunk/octave-forge/extra/oct2mat/inst/striplegend.m 2010-04-28 21:46:29 UTC (rev 7277) +++ trunk/octave-forge/extra/oct2mat/inst/striplegend.m 2010-04-29 07:48:06 UTC (rev 7278) @@ -1,14 +0,0 @@ -function y=striplegend(x) - start = 0; - stop = 0; - for i=1:length(x) - if x(i) == ';' - if start==0, start = i; - else stop = i; - end - end - end - if start & stop, x(start:stop) = []; - elseif start, x(start:length(x)) = []; - end - y=x; Deleted: trunk/octave-forge/extra/oct2mat/inst/substr.m =================================================================== --- trunk/octave-forge/extra/oct2mat/inst/substr.m 2010-04-28 21:46:29 UTC (rev 7277) +++ trunk/octave-forge/extra/oct2mat/inst/substr.m 2010-04-29 07:48:06 UTC (rev 7278) @@ -1,2 +0,0 @@ -function y = substr(s, i, j) - y = s(i:i+j-1); Deleted: trunk/octave-forge/extra/oct2mat/inst/toascii.m =================================================================== --- trunk/octave-forge/extra/oct2mat/inst/toascii.m 2010-04-28 21:46:29 UTC (rev 7277) +++ trunk/octave-forge/extra/oct2mat/inst/toascii.m 2010-04-29 07:48:06 UTC (rev 7278) @@ -1,4 +0,0 @@ -function y=toascii(x) - if isstr(x), y=x; - else y=string(x); - end Deleted: trunk/octave-forge/extra/oct2mat/inst/tolower.m =================================================================== --- trunk/octave-forge/extra/oct2mat/inst/tolower.m 2010-04-28 21:46:29 UTC (rev 7277) +++ trunk/octave-forge/extra/oct2mat/inst/tolower.m 2010-04-29 07:48:06 UTC (rev 7278) @@ -1,7 +0,0 @@ -function retval = tolower (s) - - if (nargin != 1) - error ('t = tolower (s)'); - endif - - retval = lower (s); Deleted: trunk/octave-forge/extra/oct2mat/inst/toupper.m =================================================================== --- trunk/octave-forge/extra/oct2mat/inst/toupper.m 2010-04-28 21:46:29 UTC (rev 7277) +++ trunk/octave-forge/extra/oct2mat/inst/toupper.m 2010-04-29 07:48:06 UTC (rev 7278) @@ -1,7 +0,0 @@ -function retval = toupper (s) - - if (nargin != 1) - error ('t = toupper (s)'); - endif - - retval = upper (s); Modified: trunk/octave-forge/main/image/inst/corr2.m =================================================================== --- trunk/octave-forge/main/image/inst/corr2.m 2010-04-28 21:46:29 UTC (rev 7277) +++ trunk/octave-forge/main/image/inst/corr2.m 2010-04-29 07:48:06 UTC (rev 7278) @@ -30,7 +30,7 @@ print_usage (); endif - if !(ismatrix(I) && isreal(I) && is_matrix(J) && isreal(J)) + if !(ismatrix(I) && isreal(I) && ismatrix(J) && isreal(J)) error("corr2: argument must be a real type matrix"); endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |