changeset 5153:ee2af1e830b2

[project @ 2005-02-21 21:01:42 by jwe]
author jwe
date Mon, 21 Feb 2005 21:01:42 +0000
parents b111ca4715c6
children 9cb38bfb04ea
files scripts/ChangeLog scripts/statistics/base/qqplot.m
diffstat 2 files changed, 10 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/ChangeLog	Mon Feb 21 19:41:23 2005 +0000
+++ b/scripts/ChangeLog	Mon Feb 21 21:01:42 2005 +0000
@@ -1,5 +1,7 @@
 2005-02-21  John W. Eaton  <jwe@octave.org>
 
+	* statistics/base/qqplot.m: Use feval instead of eval.
+
 	* plot/grid.m, plot/plot_border.m, plot/title.m, plot/top_title.m,
 	plot/__axis_label__.m: Issue replot command.
 
--- a/scripts/statistics/base/qqplot.m	Mon Feb 21 19:41:23 2005 +0000
+++ b/scripts/statistics/base/qqplot.m	Mon Feb 21 21:01:42 2005 +0000
@@ -67,12 +67,14 @@
     q = feval (f, t);
     q_label = func2str (f);
   else
-    param_string = sprintf ("%g", varargin{1});
-    for k = 2 : (nargin - 2);
-      param_string = sprintf ("%s, %g", param_string, varargin{k})
-    endfor
-    q = eval (sprintf ("%s (t, %s);", f, param_string));
-    q_label = sprintf ("%s with parameter(s) %s", func2str (f), param_string);
+    q = feval (f, t, varargin{:});
+    if (nargin > 3)
+      tmp = sprintf (", %g", varargin{2:end});
+    else 
+      tmp = "";
+    endif
+    q_label = sprintf ("%s with parameter(s) %g%s", func2str (f),
+		       varargin{1}, tmp);
   endif
 
   if (nargout == 0)